@acorex/connectivity 20.0.25 → 20.1.0
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/api/index.d.ts +62 -27
- package/fesm2022/acorex-connectivity-api.mjs +862 -152
- package/fesm2022/acorex-connectivity-api.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock.mjs +1102 -721
- package/fesm2022/acorex-connectivity-mock.mjs.map +1 -1
- package/mock/index.d.ts +48 -25
- package/package.json +1 -1
package/api/index.d.ts
CHANGED
@@ -5,7 +5,7 @@ import * as i0 from '@angular/core';
|
|
5
5
|
import * as i1 from 'angular-oauth2-oidc';
|
6
6
|
import { AuthConfig } from 'angular-oauth2-oidc';
|
7
7
|
import * as i2 from '@acorex/platform/auth';
|
8
|
-
import { AXPApplicationLoader, AXPApplication, AXPFeatureLoader, AXPFeature,
|
8
|
+
import { AXPApplicationLoader, AXPApplication, AXPFeatureLoader, AXPFeature, AXPBaseCredentials, AXPAuthStrategy, AXPSignInResult, AXPSessionContext, AXPRefreshTokenResult, AXPPermissionLoader, AXPPermission, AXPTenantLoader, AXPTenant } from '@acorex/platform/auth';
|
9
9
|
import { Observable } from 'rxjs';
|
10
10
|
|
11
11
|
declare class AXCApiEntityStorageService implements AXPEntityStorageService<string, any> {
|
@@ -120,33 +120,19 @@ declare class AXMOidcFeatureLoader implements AXPFeatureLoader {
|
|
120
120
|
getList(): Observable<AXPFeature[]>;
|
121
121
|
}
|
122
122
|
|
123
|
-
declare class AXMOidcStrategy implements AXPAuthStrategy {
|
124
|
-
private aXMAuthConfigs;
|
125
|
-
private oauthService;
|
126
|
-
private http;
|
127
|
-
userInfo: any;
|
128
|
-
authConfig: AuthConfig;
|
129
|
-
openidConfigurationInfo: any;
|
130
|
-
configureOAuth(): Promise<void>;
|
131
|
-
signin(credentials: AXPUserPassCredentials): Promise<AXPSignInResult>;
|
132
|
-
signout(): Promise<void>;
|
133
|
-
refreshToken(context: AXPSessionContext): Promise<AXPRefreshTokenResult>;
|
134
|
-
refresh(tenantId?: string, applicationId?: string): Promise<boolean>;
|
135
|
-
expires_in_milisecound(expires_in_date: string): number;
|
136
|
-
private setServiceProps;
|
137
|
-
private loadAuthData;
|
138
|
-
loadUserInfo(): Promise<object>;
|
139
|
-
calculateExpireInDate(expireInMilisecound: number): string;
|
140
|
-
private logout;
|
141
|
-
private handleError;
|
142
|
-
get name(): string;
|
143
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXMOidcStrategy, never>;
|
144
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AXMOidcStrategy>;
|
145
|
-
}
|
146
123
|
interface AXPUserPassCredentials extends AXPBaseCredentials {
|
147
124
|
username: string;
|
148
125
|
password: string;
|
149
126
|
}
|
127
|
+
interface AXPOAuthExternalCredentials extends AXPBaseCredentials {
|
128
|
+
strategy: string;
|
129
|
+
accessToken: string;
|
130
|
+
refreshToken: string;
|
131
|
+
idToken: string;
|
132
|
+
user: string;
|
133
|
+
expiresIn: string;
|
134
|
+
provider: string;
|
135
|
+
}
|
150
136
|
interface IAuthenticationDataModel {
|
151
137
|
access_token: string;
|
152
138
|
applicationid: string;
|
@@ -167,6 +153,56 @@ interface IAuthenticationDataModel {
|
|
167
153
|
fullname?: string;
|
168
154
|
picture?: string;
|
169
155
|
}
|
156
|
+
declare class AXCAPIOidcStrategy extends AXPAuthStrategy {
|
157
|
+
private aXMAuthConfigs;
|
158
|
+
private oauthService;
|
159
|
+
private http;
|
160
|
+
private sessionService;
|
161
|
+
userInfo: any;
|
162
|
+
authConfig: AuthConfig;
|
163
|
+
openidConfigurationInfo: any;
|
164
|
+
configureOAuth(): Promise<void>;
|
165
|
+
signin(credentials: AXPBaseCredentials): Promise<AXPSignInResult>;
|
166
|
+
/**
|
167
|
+
* Handles OIDC password-based authentication
|
168
|
+
*/
|
169
|
+
private handleOidcPasswordSignin;
|
170
|
+
signout(): Promise<void>;
|
171
|
+
refreshToken(context: AXPSessionContext): Promise<AXPRefreshTokenResult>;
|
172
|
+
/**
|
173
|
+
* Starts the OIDC authorization code flow, redirecting to the authorize endpoint with tenant_id and application_id as query params.
|
174
|
+
*/
|
175
|
+
startAuthorizationFlow(tenantId: string, applicationId: string): Promise<void>;
|
176
|
+
/**
|
177
|
+
* Unified method to complete the authorization code flow.
|
178
|
+
*/
|
179
|
+
completeAuthorizationCodeFlow(options: {
|
180
|
+
code: string;
|
181
|
+
redirectUri: string;
|
182
|
+
clientId?: string;
|
183
|
+
tokenEndpoint?: string;
|
184
|
+
}): Promise<void>;
|
185
|
+
private generateRandomString;
|
186
|
+
private generateCodeChallenge;
|
187
|
+
private base64UrlEncode;
|
188
|
+
expires_in_milisecound(expires_in_date: string): number;
|
189
|
+
private loadAuthData;
|
190
|
+
loadUserInfo(): Promise<object>;
|
191
|
+
calculateExpireInDate(expireInMilisecound: number): string;
|
192
|
+
private handleError;
|
193
|
+
get name(): string;
|
194
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXCAPIOidcStrategy, never>;
|
195
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXCAPIOidcStrategy>;
|
196
|
+
}
|
197
|
+
declare class JwtUtil {
|
198
|
+
/**
|
199
|
+
* Decodes a JWT token and returns its payload as an object.
|
200
|
+
* @param token JWT string
|
201
|
+
*/
|
202
|
+
static parseJwt(token: string): any;
|
203
|
+
static createJwt(payload: any): string;
|
204
|
+
static base64url(obj: any): string;
|
205
|
+
}
|
170
206
|
|
171
207
|
declare class AXMOidcPermissionLoader implements AXPPermissionLoader {
|
172
208
|
private http;
|
@@ -183,7 +219,6 @@ declare class AXMOidcTenantLoader implements AXPTenantLoader {
|
|
183
219
|
private http;
|
184
220
|
private configs;
|
185
221
|
private apiGetTenants;
|
186
|
-
private apiSetTenant;
|
187
222
|
constructor(http: HttpClient);
|
188
223
|
getList(): Observable<AXPTenant[]>;
|
189
224
|
set(tenant: AXPTenant): Promise<void>;
|
@@ -192,5 +227,5 @@ declare class AXMOidcTenantLoader implements AXPTenantLoader {
|
|
192
227
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXMOidcTenantLoader>;
|
193
228
|
}
|
194
229
|
|
195
|
-
export { AXCApiEntityStorageService, AXCApiModule, AXMConfigurationService, AXMOidcApplicationLoader, AXMOidcFeatureLoader, AXMOidcPermissionLoader,
|
196
|
-
export type { AXPUserPassCredentials, ApplicationConfiguration, Auth, Culture, IAuthenticationDataModel, Language, Localization, NameValue, Resource };
|
230
|
+
export { AXCAPIOidcStrategy, AXCApiEntityStorageService, AXCApiModule, AXMConfigurationService, AXMOidcApplicationLoader, AXMOidcFeatureLoader, AXMOidcPermissionLoader, AXMOidcTenantLoader, JwtUtil };
|
231
|
+
export type { AXPOAuthExternalCredentials, AXPUserPassCredentials, ApplicationConfiguration, Auth, Culture, IAuthenticationDataModel, Language, Localization, NameValue, Resource };
|