@descope/angular-sdk 0.0.0-next-cc7eda17-20231228 → 0.0.0-next-8c050e76-20231228
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 +11 -450
- package/environment.d.ts +3 -0
- package/esm2022/descope-angular-sdk.mjs +5 -0
- package/esm2022/environment.mjs +4 -0
- package/esm2022/lib/components/descope/descope.component.mjs +106 -0
- package/esm2022/lib/components/sign-in-flow/sign-in-flow.component.mjs +40 -0
- package/esm2022/lib/components/sign-up-flow/sign-up-flow.component.mjs +40 -0
- package/esm2022/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.mjs +40 -0
- package/esm2022/lib/descope-auth.module.mjs +52 -0
- package/esm2022/lib/services/descope-auth.guard.mjs +15 -0
- package/esm2022/lib/services/descope-auth.service.mjs +139 -0
- package/esm2022/lib/services/descope.interceptor.mjs +51 -0
- package/esm2022/lib/types/types.mjs +6 -0
- package/esm2022/lib/utils/constants.mjs +7 -0
- package/esm2022/lib/utils/helpers.mjs +27 -0
- package/esm2022/public-api.mjs +13 -0
- package/fesm2022/descope-angular-sdk.mjs +500 -0
- package/fesm2022/descope-angular-sdk.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/descope/descope.component.d.ts +32 -0
- package/lib/components/sign-in-flow/sign-in-flow.component.d.ts +24 -0
- package/lib/components/sign-up-flow/sign-up-flow.component.d.ts +24 -0
- package/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.d.ts +24 -0
- package/lib/descope-auth.module.d.ts +14 -0
- package/lib/services/descope-auth.guard.d.ts +2 -0
- package/lib/services/descope-auth.service.d.ts +38 -0
- package/lib/services/descope.interceptor.d.ts +2 -0
- package/lib/types/types.d.ts +8 -0
- package/lib/utils/constants.d.ts +5 -0
- package/lib/utils/helpers.d.ts +5 -0
- package/package.json +38 -77
- package/{projects/angular-sdk/src/public-api.ts → public-api.d.ts} +0 -4
- package/.editorconfig +0 -16
- package/.eslintrc.json +0 -40
- package/.github/workflows/ci.yml +0 -98
- package/.github/workflows/publish-next.yml +0 -43
- package/.github/workflows/publish.yml +0 -31
- package/.github/workflows/release.yml +0 -41
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -8
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/settings.json +0 -3
- package/.vscode/tasks.json +0 -42
- package/LICENSE +0 -21
- package/angular.json +0 -154
- package/jest.config.js +0 -17
- package/projects/angular-sdk/.eslintrc.json +0 -32
- package/projects/angular-sdk/README.md +0 -21
- package/projects/angular-sdk/ng-package.json +0 -8
- package/projects/angular-sdk/src/environment.ts +0 -3
- package/projects/angular-sdk/src/lib/components/descope/descope.component.spec.ts +0 -104
- package/projects/angular-sdk/src/lib/components/descope/descope.component.ts +0 -114
- package/projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.html +0 -15
- package/projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.spec.ts +0 -53
- package/projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.ts +0 -32
- package/projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.html +0 -15
- package/projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.spec.ts +0 -51
- package/projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.ts +0 -32
- package/projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.html +0 -15
- package/projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.spec.ts +0 -53
- package/projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.ts +0 -32
- package/projects/angular-sdk/src/lib/descope-auth.module.ts +0 -46
- package/projects/angular-sdk/src/lib/services/descope-auth.guard.spec.ts +0 -76
- package/projects/angular-sdk/src/lib/services/descope-auth.guard.ts +0 -16
- package/projects/angular-sdk/src/lib/services/descope-auth.service.spec.ts +0 -264
- package/projects/angular-sdk/src/lib/services/descope-auth.service.ts +0 -176
- package/projects/angular-sdk/src/lib/services/descope.interceptor.spec.ts +0 -102
- package/projects/angular-sdk/src/lib/services/descope.interceptor.ts +0 -76
- package/projects/angular-sdk/src/lib/types/types.ts +0 -10
- package/projects/angular-sdk/src/lib/utils/constants.ts +0 -8
- package/projects/angular-sdk/src/lib/utils/helpers.spec.ts +0 -103
- package/projects/angular-sdk/src/lib/utils/helpers.ts +0 -36
- package/projects/angular-sdk/tsconfig.lib.json +0 -12
- package/projects/angular-sdk/tsconfig.lib.prod.json +0 -10
- package/projects/angular-sdk/tsconfig.spec.json +0 -11
- package/projects/demo-app/.eslintrc.json +0 -31
- package/projects/demo-app/src/app/app-routing.module.ts +0 -23
- package/projects/demo-app/src/app/app.component.html +0 -3
- package/projects/demo-app/src/app/app.component.scss +0 -16
- package/projects/demo-app/src/app/app.component.spec.ts +0 -37
- package/projects/demo-app/src/app/app.component.ts +0 -8
- package/projects/demo-app/src/app/app.module.ts +0 -52
- package/projects/demo-app/src/app/home/home.component.html +0 -23
- package/projects/demo-app/src/app/home/home.component.scss +0 -15
- package/projects/demo-app/src/app/home/home.component.spec.ts +0 -44
- package/projects/demo-app/src/app/home/home.component.ts +0 -61
- package/projects/demo-app/src/app/interceptor/auth.interceptor.ts +0 -20
- package/projects/demo-app/src/app/login/login.component.html +0 -12
- package/projects/demo-app/src/app/login/login.component.spec.ts +0 -42
- package/projects/demo-app/src/app/login/login.component.ts +0 -35
- package/projects/demo-app/src/app/protected/protected.component.html +0 -18
- package/projects/demo-app/src/app/protected/protected.component.scss +0 -8
- package/projects/demo-app/src/app/protected/protected.component.spec.ts +0 -42
- package/projects/demo-app/src/app/protected/protected.component.ts +0 -40
- package/projects/demo-app/src/assets/.gitkeep +0 -0
- package/projects/demo-app/src/environments/conifg.ts +0 -13
- package/projects/demo-app/src/environments/environment.ts +0 -19
- package/projects/demo-app/src/favicon.ico +0 -0
- package/projects/demo-app/src/index.html +0 -17
- package/projects/demo-app/src/main.ts +0 -7
- package/projects/demo-app/src/styles.scss +0 -21
- package/projects/demo-app/tsconfig.app.json +0 -10
- package/projects/demo-app/tsconfig.spec.json +0 -10
- package/renovate.json +0 -4
- package/scripts/gitleaks/.gitleaks.toml +0 -653
- package/scripts/gitleaks/gitleaks.sh +0 -34
- package/scripts/setversion/setversion.js +0 -20
- package/setup-jest.ts +0 -1
- package/thirdPartyLicenseCollector_linux_amd64 +0 -0
- package/tsconfig.json +0 -35
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, inject, EventEmitter, Component, Input, Output, NgModule, CUSTOM_ELEMENTS_SCHEMA, Optional, SkipSelf } from '@angular/core';
|
|
3
|
+
import createSdk from '@descope/web-js-sdk';
|
|
4
|
+
import { from, BehaviorSubject, tap, finalize, of, throwError } from 'rxjs';
|
|
5
|
+
import { Router } from '@angular/router';
|
|
6
|
+
import { switchMap, catchError } from 'rxjs/operators';
|
|
7
|
+
import DescopeWebComponent from '@descope/web-component';
|
|
8
|
+
|
|
9
|
+
function observabilify(value) {
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11
|
+
const observableValue = {};
|
|
12
|
+
for (const key in value) {
|
|
13
|
+
if (typeof value[key] === 'function') {
|
|
14
|
+
const fn = value[key];
|
|
15
|
+
observableValue[key] = (...args) => {
|
|
16
|
+
const fnResult = fn(...args);
|
|
17
|
+
if (fnResult instanceof Promise) {
|
|
18
|
+
return from(fnResult);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return fnResult;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
else if (typeof value[key] === 'object' && value[key] !== null) {
|
|
26
|
+
observableValue[key] = observabilify(value[key]);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
observableValue[key] = value[key];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return observableValue;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const environment = {
|
|
36
|
+
buildVersion: '0.0.0-next-8c050e76-20231228'
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const baseHeaders = {
|
|
40
|
+
'x-descope-sdk-name': 'angular',
|
|
41
|
+
'x-descope-sdk-version': environment.buildVersion
|
|
42
|
+
};
|
|
43
|
+
const isBrowser = () => typeof window !== 'undefined';
|
|
44
|
+
|
|
45
|
+
class DescopeAuthConfig {
|
|
46
|
+
constructor() {
|
|
47
|
+
this.projectId = '';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
class DescopeAuthService {
|
|
52
|
+
constructor(config) {
|
|
53
|
+
this.descopeSdk = observabilify(createSdk({
|
|
54
|
+
...config,
|
|
55
|
+
persistTokens: isBrowser(),
|
|
56
|
+
autoRefresh: isBrowser(),
|
|
57
|
+
baseHeaders
|
|
58
|
+
}));
|
|
59
|
+
this.sessionSubject = new BehaviorSubject({
|
|
60
|
+
isAuthenticated: false,
|
|
61
|
+
isSessionLoading: false,
|
|
62
|
+
sessionToken: ''
|
|
63
|
+
});
|
|
64
|
+
this.session$ = this.sessionSubject.asObservable();
|
|
65
|
+
this.userSubject = new BehaviorSubject({
|
|
66
|
+
isUserLoading: false
|
|
67
|
+
});
|
|
68
|
+
this.user$ = this.userSubject.asObservable();
|
|
69
|
+
this.descopeSdk.onSessionTokenChange(this.setSession.bind(this));
|
|
70
|
+
this.descopeSdk.onUserChange(this.setUser.bind(this));
|
|
71
|
+
}
|
|
72
|
+
refreshSession() {
|
|
73
|
+
const beforeRefreshSession = this.sessionSubject.value;
|
|
74
|
+
this.sessionSubject.next({
|
|
75
|
+
...beforeRefreshSession,
|
|
76
|
+
isSessionLoading: true
|
|
77
|
+
});
|
|
78
|
+
return this.descopeSdk.refresh().pipe(tap((data) => {
|
|
79
|
+
const afterRequestSession = this.sessionSubject.value;
|
|
80
|
+
if (data.ok && data.data) {
|
|
81
|
+
this.sessionSubject.next({
|
|
82
|
+
...afterRequestSession,
|
|
83
|
+
sessionToken: data.data.sessionJwt,
|
|
84
|
+
isAuthenticated: !!data.data.sessionJwt
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.sessionSubject.next({
|
|
89
|
+
...afterRequestSession,
|
|
90
|
+
sessionToken: '',
|
|
91
|
+
isAuthenticated: false
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}), finalize(() => {
|
|
95
|
+
const afterRefreshSession = this.sessionSubject.value;
|
|
96
|
+
this.sessionSubject.next({
|
|
97
|
+
...afterRefreshSession,
|
|
98
|
+
isSessionLoading: false
|
|
99
|
+
});
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
refreshUser() {
|
|
103
|
+
const beforeRefreshUser = this.userSubject.value;
|
|
104
|
+
this.userSubject.next({
|
|
105
|
+
...beforeRefreshUser,
|
|
106
|
+
isUserLoading: true
|
|
107
|
+
});
|
|
108
|
+
return this.descopeSdk.me().pipe(tap((data) => {
|
|
109
|
+
const afterRequestUser = this.userSubject.value;
|
|
110
|
+
if (data.data) {
|
|
111
|
+
this.userSubject.next({
|
|
112
|
+
...afterRequestUser,
|
|
113
|
+
user: {
|
|
114
|
+
...data.data
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}), finalize(() => {
|
|
119
|
+
const afterRefreshUser = this.userSubject.value;
|
|
120
|
+
this.userSubject.next({
|
|
121
|
+
...afterRefreshUser,
|
|
122
|
+
isUserLoading: false
|
|
123
|
+
});
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
getSessionToken() {
|
|
127
|
+
if (isBrowser()) {
|
|
128
|
+
return this.descopeSdk.getSessionToken();
|
|
129
|
+
}
|
|
130
|
+
console.warn('Get session token is not supported in SSR');
|
|
131
|
+
return '';
|
|
132
|
+
}
|
|
133
|
+
getRefreshToken() {
|
|
134
|
+
if (isBrowser()) {
|
|
135
|
+
return this.descopeSdk.getRefreshToken();
|
|
136
|
+
}
|
|
137
|
+
this.descopeSdk.getJwtPermissions;
|
|
138
|
+
console.warn('Get refresh token is not supported in SSR');
|
|
139
|
+
return '';
|
|
140
|
+
}
|
|
141
|
+
getJwtPermissions(token = this.getSessionToken(), tenant) {
|
|
142
|
+
if (token === null) {
|
|
143
|
+
console.error('Could not get JWT Permissions - not authenticated');
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
return this.descopeSdk.getJwtPermissions(token, tenant);
|
|
147
|
+
}
|
|
148
|
+
getJwtRoles(token = this.getSessionToken(), tenant) {
|
|
149
|
+
if (token === null) {
|
|
150
|
+
console.error('Could not get JWT Roles - not authenticated');
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
return this.descopeSdk.getJwtRoles(token, tenant);
|
|
154
|
+
}
|
|
155
|
+
isAuthenticated() {
|
|
156
|
+
return this.sessionSubject.value.isAuthenticated;
|
|
157
|
+
}
|
|
158
|
+
setSession(sessionToken) {
|
|
159
|
+
const currentSession = this.sessionSubject.value;
|
|
160
|
+
this.sessionSubject.next({
|
|
161
|
+
sessionToken,
|
|
162
|
+
isAuthenticated: !!sessionToken,
|
|
163
|
+
isSessionLoading: currentSession.isSessionLoading
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
setUser(user) {
|
|
167
|
+
const currentUser = this.userSubject.value;
|
|
168
|
+
this.userSubject.next({
|
|
169
|
+
isUserLoading: currentUser.isUserLoading,
|
|
170
|
+
user
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DescopeAuthService, deps: [{ token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
174
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DescopeAuthService, providedIn: 'root' }); }
|
|
175
|
+
}
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DescopeAuthService, decorators: [{
|
|
177
|
+
type: Injectable,
|
|
178
|
+
args: [{
|
|
179
|
+
providedIn: 'root'
|
|
180
|
+
}]
|
|
181
|
+
}], ctorParameters: function () { return [{ type: DescopeAuthConfig }]; } });
|
|
182
|
+
|
|
183
|
+
const descopeAuthGuard = (route) => {
|
|
184
|
+
const authService = inject(DescopeAuthService);
|
|
185
|
+
const router = inject(Router);
|
|
186
|
+
const fallbackUrl = route.data['descopeFallbackUrl'];
|
|
187
|
+
const isAuthenticated = authService.isAuthenticated();
|
|
188
|
+
if (!isAuthenticated && !!fallbackUrl) {
|
|
189
|
+
return from(router.navigate([fallbackUrl]));
|
|
190
|
+
}
|
|
191
|
+
return of(isAuthenticated);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const descopeInterceptor = (request, next) => {
|
|
195
|
+
const config = inject(DescopeAuthConfig);
|
|
196
|
+
const authService = inject(DescopeAuthService);
|
|
197
|
+
function refreshAndRetry(request, next, error) {
|
|
198
|
+
return authService.refreshSession().pipe(switchMap((refreshed) => {
|
|
199
|
+
if (refreshed.ok && refreshed.data) {
|
|
200
|
+
const requestWithRefreshedToken = addTokenToRequest(request, refreshed.data?.sessionJwt);
|
|
201
|
+
return next(requestWithRefreshedToken);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
return throwError(() => error ?? new Error('Could not refresh session!'));
|
|
205
|
+
}
|
|
206
|
+
}));
|
|
207
|
+
}
|
|
208
|
+
function shouldIntercept(request) {
|
|
209
|
+
return ((config.pathsToIntercept?.length === 0 ||
|
|
210
|
+
config.pathsToIntercept?.some((path) => request.url.includes(path))) ??
|
|
211
|
+
true);
|
|
212
|
+
}
|
|
213
|
+
function addTokenToRequest(request, token) {
|
|
214
|
+
return request.clone({
|
|
215
|
+
setHeaders: {
|
|
216
|
+
Authorization: `Bearer ${token}`
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
if (shouldIntercept(request)) {
|
|
221
|
+
const token = authService.getSessionToken();
|
|
222
|
+
if (!token) {
|
|
223
|
+
return refreshAndRetry(request, next);
|
|
224
|
+
}
|
|
225
|
+
const requestWithToken = addTokenToRequest(request, token);
|
|
226
|
+
return next(requestWithToken).pipe(catchError((error) => {
|
|
227
|
+
if (error.status === 401 || error.status === 403) {
|
|
228
|
+
return refreshAndRetry(request, next, error);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
return throwError(() => error);
|
|
232
|
+
}
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
return next(request);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
class DescopeComponent {
|
|
241
|
+
constructor(elementRef, authService, descopeConfig) {
|
|
242
|
+
this.elementRef = elementRef;
|
|
243
|
+
this.authService = authService;
|
|
244
|
+
this.success = new EventEmitter();
|
|
245
|
+
this.error = new EventEmitter();
|
|
246
|
+
this.webComponent = new DescopeWebComponent();
|
|
247
|
+
this.projectId = descopeConfig.projectId;
|
|
248
|
+
}
|
|
249
|
+
ngOnInit() {
|
|
250
|
+
DescopeWebComponent.sdkConfigOverrides = { baseHeaders };
|
|
251
|
+
this.setupWebComponent();
|
|
252
|
+
this.elementRef.nativeElement.appendChild(this.webComponent);
|
|
253
|
+
}
|
|
254
|
+
ngOnChanges() {
|
|
255
|
+
this.setupWebComponent();
|
|
256
|
+
}
|
|
257
|
+
setupWebComponent() {
|
|
258
|
+
this.webComponent.setAttribute('project-id', this.projectId);
|
|
259
|
+
this.webComponent.setAttribute('flow-id', this.flowId);
|
|
260
|
+
if (this.locale) {
|
|
261
|
+
this.webComponent.setAttribute('locale', this.locale);
|
|
262
|
+
}
|
|
263
|
+
if (this.theme) {
|
|
264
|
+
this.webComponent.setAttribute('theme', this.theme);
|
|
265
|
+
}
|
|
266
|
+
if (this.tenant) {
|
|
267
|
+
this.webComponent.setAttribute('tenant', this.tenant);
|
|
268
|
+
}
|
|
269
|
+
if (this.telemetryKey) {
|
|
270
|
+
this.webComponent.setAttribute('telemetryKey', this.telemetryKey);
|
|
271
|
+
}
|
|
272
|
+
if (this.redirectUrl) {
|
|
273
|
+
this.webComponent.setAttribute('redirect-url', this.redirectUrl);
|
|
274
|
+
}
|
|
275
|
+
if (this.autoFocus) {
|
|
276
|
+
this.webComponent.setAttribute('auto-focus', this.autoFocus.toString());
|
|
277
|
+
}
|
|
278
|
+
if (this.debug) {
|
|
279
|
+
this.webComponent.setAttribute('debug', this.debug.toString());
|
|
280
|
+
}
|
|
281
|
+
if (this.errorTransformer) {
|
|
282
|
+
this.webComponent.errorTransformer = this.errorTransformer;
|
|
283
|
+
}
|
|
284
|
+
if (this.logger) {
|
|
285
|
+
this.webComponent.logger = this.logger;
|
|
286
|
+
}
|
|
287
|
+
if (this.success) {
|
|
288
|
+
this.webComponent.addEventListener('success', (e) => {
|
|
289
|
+
from(this.authService.descopeSdk.httpClient.hooks?.afterRequest(
|
|
290
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
291
|
+
{}, new Response(JSON.stringify(e.detail)))).subscribe(() => {
|
|
292
|
+
this.success?.emit();
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
if (this.error) {
|
|
297
|
+
this.webComponent.addEventListener('error', () => {
|
|
298
|
+
this.error?.emit();
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DescopeComponent, deps: [{ token: i0.ElementRef }, { token: DescopeAuthService }, { token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
303
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: DescopeComponent, isStandalone: true, selector: "descope[flowId]", inputs: { flowId: "flowId", locale: "locale", theme: "theme", tenant: "tenant", telemetryKey: "telemetryKey", redirectUrl: "redirectUrl", autoFocus: "autoFocus", debug: "debug", errorTransformer: "errorTransformer", logger: "logger" }, outputs: { success: "success", error: "error" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
|
|
304
|
+
}
|
|
305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DescopeComponent, decorators: [{
|
|
306
|
+
type: Component,
|
|
307
|
+
args: [{
|
|
308
|
+
selector: 'descope[flowId]',
|
|
309
|
+
standalone: true,
|
|
310
|
+
template: ''
|
|
311
|
+
}]
|
|
312
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: DescopeAuthService }, { type: DescopeAuthConfig }]; }, propDecorators: { flowId: [{
|
|
313
|
+
type: Input
|
|
314
|
+
}], locale: [{
|
|
315
|
+
type: Input
|
|
316
|
+
}], theme: [{
|
|
317
|
+
type: Input
|
|
318
|
+
}], tenant: [{
|
|
319
|
+
type: Input
|
|
320
|
+
}], telemetryKey: [{
|
|
321
|
+
type: Input
|
|
322
|
+
}], redirectUrl: [{
|
|
323
|
+
type: Input
|
|
324
|
+
}], autoFocus: [{
|
|
325
|
+
type: Input
|
|
326
|
+
}], debug: [{
|
|
327
|
+
type: Input
|
|
328
|
+
}], errorTransformer: [{
|
|
329
|
+
type: Input
|
|
330
|
+
}], logger: [{
|
|
331
|
+
type: Input
|
|
332
|
+
}], success: [{
|
|
333
|
+
type: Output
|
|
334
|
+
}], error: [{
|
|
335
|
+
type: Output
|
|
336
|
+
}] } });
|
|
337
|
+
|
|
338
|
+
class SignInFlowComponent {
|
|
339
|
+
constructor(descopeConfig) {
|
|
340
|
+
this.success = new EventEmitter();
|
|
341
|
+
this.error = new EventEmitter();
|
|
342
|
+
this.projectId = descopeConfig.projectId;
|
|
343
|
+
}
|
|
344
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SignInFlowComponent, deps: [{ token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
345
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: SignInFlowComponent, isStandalone: true, selector: "descope-sign-in-flow", inputs: { locale: "locale", theme: "theme", tenant: "tenant", telemetryKey: "telemetryKey", redirectUrl: "redirectUrl", autoFocus: "autoFocus", debug: "debug", errorTransformer: "errorTransformer", logger: "logger" }, outputs: { success: "success", error: "error" }, ngImport: i0, template: "<descope\n\t(success)=\"success.emit()\"\n\t(error)=\"error.emit()\"\n\tflowId=\"sign-in\"\n\t[locale]=\"locale\"\n\t[theme]=\"theme\"\n\t[tenant]=\"tenant\"\n\t[telemetryKey]=\"telemetryKey\"\n\t[redirectUrl]=\"redirectUrl\"\n\t[autoFocus]=\"autoFocus\"\n\t[debug]=\"debug\"\n\t[errorTransformer]=\"errorTransformer\"\n\t[logger]=\"logger\"\n>\n</descope>\n", dependencies: [{ kind: "component", type: DescopeComponent, selector: "descope[flowId]", inputs: ["flowId", "locale", "theme", "tenant", "telemetryKey", "redirectUrl", "autoFocus", "debug", "errorTransformer", "logger"], outputs: ["success", "error"] }] }); }
|
|
346
|
+
}
|
|
347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SignInFlowComponent, decorators: [{
|
|
348
|
+
type: Component,
|
|
349
|
+
args: [{ selector: 'descope-sign-in-flow', standalone: true, imports: [DescopeComponent], template: "<descope\n\t(success)=\"success.emit()\"\n\t(error)=\"error.emit()\"\n\tflowId=\"sign-in\"\n\t[locale]=\"locale\"\n\t[theme]=\"theme\"\n\t[tenant]=\"tenant\"\n\t[telemetryKey]=\"telemetryKey\"\n\t[redirectUrl]=\"redirectUrl\"\n\t[autoFocus]=\"autoFocus\"\n\t[debug]=\"debug\"\n\t[errorTransformer]=\"errorTransformer\"\n\t[logger]=\"logger\"\n>\n</descope>\n" }]
|
|
350
|
+
}], ctorParameters: function () { return [{ type: DescopeAuthConfig }]; }, propDecorators: { locale: [{
|
|
351
|
+
type: Input
|
|
352
|
+
}], theme: [{
|
|
353
|
+
type: Input
|
|
354
|
+
}], tenant: [{
|
|
355
|
+
type: Input
|
|
356
|
+
}], telemetryKey: [{
|
|
357
|
+
type: Input
|
|
358
|
+
}], redirectUrl: [{
|
|
359
|
+
type: Input
|
|
360
|
+
}], autoFocus: [{
|
|
361
|
+
type: Input
|
|
362
|
+
}], debug: [{
|
|
363
|
+
type: Input
|
|
364
|
+
}], errorTransformer: [{
|
|
365
|
+
type: Input
|
|
366
|
+
}], logger: [{
|
|
367
|
+
type: Input
|
|
368
|
+
}], success: [{
|
|
369
|
+
type: Output
|
|
370
|
+
}], error: [{
|
|
371
|
+
type: Output
|
|
372
|
+
}] } });
|
|
373
|
+
|
|
374
|
+
class SignUpFlowComponent {
|
|
375
|
+
constructor(descopeConfig) {
|
|
376
|
+
this.success = new EventEmitter();
|
|
377
|
+
this.error = new EventEmitter();
|
|
378
|
+
this.projectId = descopeConfig.projectId;
|
|
379
|
+
}
|
|
380
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SignUpFlowComponent, deps: [{ token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
381
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: SignUpFlowComponent, isStandalone: true, selector: "descope-sign-up-flow", inputs: { locale: "locale", theme: "theme", tenant: "tenant", telemetryKey: "telemetryKey", redirectUrl: "redirectUrl", autoFocus: "autoFocus", debug: "debug", errorTransformer: "errorTransformer", logger: "logger" }, outputs: { success: "success", error: "error" }, ngImport: i0, template: "<descope\n\t(success)=\"success.emit()\"\n\t(error)=\"error.emit()\"\n\tflowId=\"sign-up\"\n\t[locale]=\"locale\"\n\t[theme]=\"theme\"\n\t[tenant]=\"tenant\"\n\t[telemetryKey]=\"telemetryKey\"\n\t[redirectUrl]=\"redirectUrl\"\n\t[autoFocus]=\"autoFocus\"\n\t[debug]=\"debug\"\n\t[errorTransformer]=\"errorTransformer\"\n\t[logger]=\"logger\"\n>\n</descope>\n", dependencies: [{ kind: "component", type: DescopeComponent, selector: "descope[flowId]", inputs: ["flowId", "locale", "theme", "tenant", "telemetryKey", "redirectUrl", "autoFocus", "debug", "errorTransformer", "logger"], outputs: ["success", "error"] }] }); }
|
|
382
|
+
}
|
|
383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SignUpFlowComponent, decorators: [{
|
|
384
|
+
type: Component,
|
|
385
|
+
args: [{ selector: 'descope-sign-up-flow', standalone: true, imports: [DescopeComponent], template: "<descope\n\t(success)=\"success.emit()\"\n\t(error)=\"error.emit()\"\n\tflowId=\"sign-up\"\n\t[locale]=\"locale\"\n\t[theme]=\"theme\"\n\t[tenant]=\"tenant\"\n\t[telemetryKey]=\"telemetryKey\"\n\t[redirectUrl]=\"redirectUrl\"\n\t[autoFocus]=\"autoFocus\"\n\t[debug]=\"debug\"\n\t[errorTransformer]=\"errorTransformer\"\n\t[logger]=\"logger\"\n>\n</descope>\n" }]
|
|
386
|
+
}], ctorParameters: function () { return [{ type: DescopeAuthConfig }]; }, propDecorators: { locale: [{
|
|
387
|
+
type: Input
|
|
388
|
+
}], theme: [{
|
|
389
|
+
type: Input
|
|
390
|
+
}], tenant: [{
|
|
391
|
+
type: Input
|
|
392
|
+
}], telemetryKey: [{
|
|
393
|
+
type: Input
|
|
394
|
+
}], redirectUrl: [{
|
|
395
|
+
type: Input
|
|
396
|
+
}], autoFocus: [{
|
|
397
|
+
type: Input
|
|
398
|
+
}], debug: [{
|
|
399
|
+
type: Input
|
|
400
|
+
}], errorTransformer: [{
|
|
401
|
+
type: Input
|
|
402
|
+
}], logger: [{
|
|
403
|
+
type: Input
|
|
404
|
+
}], success: [{
|
|
405
|
+
type: Output
|
|
406
|
+
}], error: [{
|
|
407
|
+
type: Output
|
|
408
|
+
}] } });
|
|
409
|
+
|
|
410
|
+
class SignUpOrInFlowComponent {
|
|
411
|
+
constructor(descopeConfig) {
|
|
412
|
+
this.success = new EventEmitter();
|
|
413
|
+
this.error = new EventEmitter();
|
|
414
|
+
this.projectId = descopeConfig.projectId;
|
|
415
|
+
}
|
|
416
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SignUpOrInFlowComponent, deps: [{ token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
417
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: SignUpOrInFlowComponent, isStandalone: true, selector: "descope-sign-up-or-in-flow", inputs: { locale: "locale", theme: "theme", tenant: "tenant", telemetryKey: "telemetryKey", redirectUrl: "redirectUrl", autoFocus: "autoFocus", debug: "debug", errorTransformer: "errorTransformer", logger: "logger" }, outputs: { success: "success", error: "error" }, ngImport: i0, template: "<descope\n\t(success)=\"success.emit()\"\n\t(error)=\"error.emit()\"\n\tflowId=\"sign-up-or-in\"\n\t[locale]=\"locale\"\n\t[theme]=\"theme\"\n\t[tenant]=\"tenant\"\n\t[telemetryKey]=\"telemetryKey\"\n\t[redirectUrl]=\"redirectUrl\"\n\t[autoFocus]=\"autoFocus\"\n\t[debug]=\"debug\"\n\t[errorTransformer]=\"errorTransformer\"\n\t[logger]=\"logger\"\n>\n</descope>\n", dependencies: [{ kind: "component", type: DescopeComponent, selector: "descope[flowId]", inputs: ["flowId", "locale", "theme", "tenant", "telemetryKey", "redirectUrl", "autoFocus", "debug", "errorTransformer", "logger"], outputs: ["success", "error"] }] }); }
|
|
418
|
+
}
|
|
419
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SignUpOrInFlowComponent, decorators: [{
|
|
420
|
+
type: Component,
|
|
421
|
+
args: [{ selector: 'descope-sign-up-or-in-flow', standalone: true, imports: [DescopeComponent], template: "<descope\n\t(success)=\"success.emit()\"\n\t(error)=\"error.emit()\"\n\tflowId=\"sign-up-or-in\"\n\t[locale]=\"locale\"\n\t[theme]=\"theme\"\n\t[tenant]=\"tenant\"\n\t[telemetryKey]=\"telemetryKey\"\n\t[redirectUrl]=\"redirectUrl\"\n\t[autoFocus]=\"autoFocus\"\n\t[debug]=\"debug\"\n\t[errorTransformer]=\"errorTransformer\"\n\t[logger]=\"logger\"\n>\n</descope>\n" }]
|
|
422
|
+
}], ctorParameters: function () { return [{ type: DescopeAuthConfig }]; }, propDecorators: { locale: [{
|
|
423
|
+
type: Input
|
|
424
|
+
}], theme: [{
|
|
425
|
+
type: Input
|
|
426
|
+
}], tenant: [{
|
|
427
|
+
type: Input
|
|
428
|
+
}], telemetryKey: [{
|
|
429
|
+
type: Input
|
|
430
|
+
}], redirectUrl: [{
|
|
431
|
+
type: Input
|
|
432
|
+
}], autoFocus: [{
|
|
433
|
+
type: Input
|
|
434
|
+
}], debug: [{
|
|
435
|
+
type: Input
|
|
436
|
+
}], errorTransformer: [{
|
|
437
|
+
type: Input
|
|
438
|
+
}], logger: [{
|
|
439
|
+
type: Input
|
|
440
|
+
}], success: [{
|
|
441
|
+
type: Output
|
|
442
|
+
}], error: [{
|
|
443
|
+
type: Output
|
|
444
|
+
}] } });
|
|
445
|
+
|
|
446
|
+
class DescopeAuthModule {
|
|
447
|
+
constructor(parentModule) {
|
|
448
|
+
if (parentModule) {
|
|
449
|
+
throw new Error('DescopeAuthModule is already loaded. Import it only once');
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
static forRoot(config) {
|
|
453
|
+
return {
|
|
454
|
+
ngModule: DescopeAuthModule,
|
|
455
|
+
providers: [{ provide: DescopeAuthConfig, useValue: config }]
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DescopeAuthModule, deps: [{ token: DescopeAuthModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
459
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.9", ngImport: i0, type: DescopeAuthModule, imports: [DescopeComponent,
|
|
460
|
+
SignInFlowComponent,
|
|
461
|
+
SignUpFlowComponent,
|
|
462
|
+
SignUpOrInFlowComponent], exports: [DescopeComponent,
|
|
463
|
+
SignInFlowComponent,
|
|
464
|
+
SignUpFlowComponent,
|
|
465
|
+
SignUpOrInFlowComponent] }); }
|
|
466
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DescopeAuthModule }); }
|
|
467
|
+
}
|
|
468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DescopeAuthModule, decorators: [{
|
|
469
|
+
type: NgModule,
|
|
470
|
+
args: [{
|
|
471
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
472
|
+
imports: [
|
|
473
|
+
DescopeComponent,
|
|
474
|
+
SignInFlowComponent,
|
|
475
|
+
SignUpFlowComponent,
|
|
476
|
+
SignUpOrInFlowComponent
|
|
477
|
+
],
|
|
478
|
+
exports: [
|
|
479
|
+
DescopeComponent,
|
|
480
|
+
SignInFlowComponent,
|
|
481
|
+
SignUpFlowComponent,
|
|
482
|
+
SignUpOrInFlowComponent
|
|
483
|
+
]
|
|
484
|
+
}]
|
|
485
|
+
}], ctorParameters: function () { return [{ type: DescopeAuthModule, decorators: [{
|
|
486
|
+
type: Optional
|
|
487
|
+
}, {
|
|
488
|
+
type: SkipSelf
|
|
489
|
+
}] }]; } });
|
|
490
|
+
|
|
491
|
+
/*
|
|
492
|
+
* Public API Surface of angular-sdk
|
|
493
|
+
*/
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Generated bundle index. Do not edit.
|
|
497
|
+
*/
|
|
498
|
+
|
|
499
|
+
export { DescopeAuthConfig, DescopeAuthModule, DescopeAuthService, DescopeComponent, SignInFlowComponent, SignUpFlowComponent, SignUpOrInFlowComponent, descopeAuthGuard, descopeInterceptor };
|
|
500
|
+
//# sourceMappingURL=descope-angular-sdk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descope-angular-sdk.mjs","sources":["../../projects/angular-sdk/src/lib/utils/helpers.ts","../../projects/angular-sdk/src/environment.ts","../../projects/angular-sdk/src/lib/utils/constants.ts","../../projects/angular-sdk/src/lib/types/types.ts","../../projects/angular-sdk/src/lib/services/descope-auth.service.ts","../../projects/angular-sdk/src/lib/services/descope-auth.guard.ts","../../projects/angular-sdk/src/lib/services/descope.interceptor.ts","../../projects/angular-sdk/src/lib/components/descope/descope.component.ts","../../projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.ts","../../projects/angular-sdk/src/lib/components/sign-in-flow/sign-in-flow.component.html","../../projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.ts","../../projects/angular-sdk/src/lib/components/sign-up-flow/sign-up-flow.component.html","../../projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.ts","../../projects/angular-sdk/src/lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component.html","../../projects/angular-sdk/src/lib/descope-auth.module.ts","../../projects/angular-sdk/src/public-api.ts","../../projects/angular-sdk/src/descope-angular-sdk.ts"],"sourcesContent":["import { from, Observable } from 'rxjs';\n\nexport type Observablefied<T> = {\n\t[K in keyof T]: T[K] extends (...args: infer Args) => Promise<infer R>\n\t\t? (...args: Args) => Observable<R>\n\t\t: T[K] extends (...args: infer Args) => infer R\n\t\t? (...args: Args) => R\n\t\t: T[K] extends object\n\t\t? Observablefied<T[K]>\n\t\t: T[K];\n};\n\nexport function observabilify<T>(value: T): Observablefied<T> {\n\t/* eslint-disable @typescript-eslint/no-explicit-any */\n\tconst observableValue: any = {};\n\n\tfor (const key in value) {\n\t\tif (typeof value[key] === 'function') {\n\t\t\tconst fn = value[key] as (...args: unknown[]) => unknown;\n\t\t\tobservableValue[key] = (...args: unknown[]) => {\n\t\t\t\tconst fnResult = fn(...args);\n\t\t\t\tif (fnResult instanceof Promise) {\n\t\t\t\t\treturn from(fnResult);\n\t\t\t\t} else {\n\t\t\t\t\treturn fnResult;\n\t\t\t\t}\n\t\t\t};\n\t\t} else if (typeof value[key] === 'object' && value[key] !== null) {\n\t\t\tobservableValue[key] = observabilify(value[key]);\n\t\t} else {\n\t\t\tobservableValue[key] = value[key];\n\t\t}\n\t}\n\n\treturn observableValue as Observablefied<T>;\n}\n","export const environment = {\n buildVersion: '0.0.0-next-8c050e76-20231228'\n};\n","import { environment } from '../../environment';\n\nexport const baseHeaders = {\n\t'x-descope-sdk-name': 'angular',\n\t'x-descope-sdk-version': environment.buildVersion\n};\n\nexport const isBrowser = () => typeof window !== 'undefined';\n","import { ILogger } from '@descope/web-component';\n\nexport class DescopeAuthConfig {\n\tprojectId = '';\n\tbaseUrl?: string;\n\tsessionTokenViaCookie?: boolean;\n\tpathsToIntercept?: string[];\n}\n\nexport type { ILogger };\n","import { Injectable } from '@angular/core';\nimport type { UserResponse } from '@descope/web-js-sdk';\nimport createSdk from '@descope/web-js-sdk';\nimport { BehaviorSubject, finalize, Observable, tap } from 'rxjs';\nimport { observabilify, Observablefied } from '../utils/helpers';\nimport { baseHeaders, isBrowser } from '../utils/constants';\nimport { DescopeAuthConfig } from '../types/types';\n\ntype DescopeSDK = ReturnType<typeof createSdk>;\ntype AngularDescopeSDK = Observablefied<DescopeSDK>;\n\nexport interface DescopeSession {\n\tisAuthenticated: boolean;\n\tisSessionLoading: boolean;\n\tsessionToken: string | null;\n}\n\nexport type DescopeUser = { user?: UserResponse; isUserLoading: boolean };\n\n@Injectable({\n\tprovidedIn: 'root'\n})\nexport class DescopeAuthService {\n\tpublic descopeSdk: AngularDescopeSDK;\n\tprivate readonly sessionSubject: BehaviorSubject<DescopeSession>;\n\tprivate readonly userSubject: BehaviorSubject<DescopeUser>;\n\treadonly session$: Observable<DescopeSession>;\n\treadonly user$: Observable<DescopeUser>;\n\n\tconstructor(config: DescopeAuthConfig) {\n\t\tthis.descopeSdk = observabilify<DescopeSDK>(\n\t\t\tcreateSdk({\n\t\t\t\t...config,\n\t\t\t\tpersistTokens: isBrowser() as true,\n\t\t\t\tautoRefresh: isBrowser() as true,\n\t\t\t\tbaseHeaders\n\t\t\t})\n\t\t);\n\n\t\tthis.sessionSubject = new BehaviorSubject<DescopeSession>({\n\t\t\tisAuthenticated: false,\n\t\t\tisSessionLoading: false,\n\t\t\tsessionToken: ''\n\t\t});\n\t\tthis.session$ = this.sessionSubject.asObservable();\n\t\tthis.userSubject = new BehaviorSubject<DescopeUser>({\n\t\t\tisUserLoading: false\n\t\t});\n\t\tthis.user$ = this.userSubject.asObservable();\n\t\tthis.descopeSdk.onSessionTokenChange(this.setSession.bind(this));\n\t\tthis.descopeSdk.onUserChange(this.setUser.bind(this));\n\t}\n\n\trefreshSession() {\n\t\tconst beforeRefreshSession = this.sessionSubject.value;\n\t\tthis.sessionSubject.next({\n\t\t\t...beforeRefreshSession,\n\t\t\tisSessionLoading: true\n\t\t});\n\t\treturn this.descopeSdk.refresh().pipe(\n\t\t\ttap((data) => {\n\t\t\t\tconst afterRequestSession = this.sessionSubject.value;\n\t\t\t\tif (data.ok && data.data) {\n\t\t\t\t\tthis.sessionSubject.next({\n\t\t\t\t\t\t...afterRequestSession,\n\t\t\t\t\t\tsessionToken: data.data.sessionJwt,\n\t\t\t\t\t\tisAuthenticated: !!data.data.sessionJwt\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.sessionSubject.next({\n\t\t\t\t\t\t...afterRequestSession,\n\t\t\t\t\t\tsessionToken: '',\n\t\t\t\t\t\tisAuthenticated: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}),\n\t\t\tfinalize(() => {\n\t\t\t\tconst afterRefreshSession = this.sessionSubject.value;\n\t\t\t\tthis.sessionSubject.next({\n\t\t\t\t\t...afterRefreshSession,\n\t\t\t\t\tisSessionLoading: false\n\t\t\t\t});\n\t\t\t})\n\t\t);\n\t}\n\n\trefreshUser() {\n\t\tconst beforeRefreshUser = this.userSubject.value;\n\t\tthis.userSubject.next({\n\t\t\t...beforeRefreshUser,\n\t\t\tisUserLoading: true\n\t\t});\n\t\treturn this.descopeSdk.me().pipe(\n\t\t\ttap((data) => {\n\t\t\t\tconst afterRequestUser = this.userSubject.value;\n\t\t\t\tif (data.data) {\n\t\t\t\t\tthis.userSubject.next({\n\t\t\t\t\t\t...afterRequestUser,\n\t\t\t\t\t\tuser: {\n\t\t\t\t\t\t\t...data.data\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}),\n\t\t\tfinalize(() => {\n\t\t\t\tconst afterRefreshUser = this.userSubject.value;\n\t\t\t\tthis.userSubject.next({\n\t\t\t\t\t...afterRefreshUser,\n\t\t\t\t\tisUserLoading: false\n\t\t\t\t});\n\t\t\t})\n\t\t);\n\t}\n\n\tgetSessionToken() {\n\t\tif (isBrowser()) {\n\t\t\treturn (\n\t\t\t\tthis.descopeSdk as AngularDescopeSDK & {\n\t\t\t\t\tgetSessionToken: () => string | null;\n\t\t\t\t}\n\t\t\t).getSessionToken();\n\t\t}\n\t\tconsole.warn('Get session token is not supported in SSR');\n\t\treturn '';\n\t}\n\n\tgetRefreshToken() {\n\t\tif (isBrowser()) {\n\t\t\treturn (\n\t\t\t\tthis.descopeSdk as AngularDescopeSDK & {\n\t\t\t\t\tgetRefreshToken: () => string | null;\n\t\t\t\t}\n\t\t\t).getRefreshToken();\n\t\t}\n\t\tthis.descopeSdk.getJwtPermissions;\n\t\tconsole.warn('Get refresh token is not supported in SSR');\n\t\treturn '';\n\t}\n\n\tgetJwtPermissions(token = this.getSessionToken(), tenant?: string) {\n\t\tif (token === null) {\n\t\t\tconsole.error('Could not get JWT Permissions - not authenticated');\n\t\t\treturn [];\n\t\t}\n\t\treturn this.descopeSdk.getJwtPermissions(token, tenant);\n\t}\n\n\tgetJwtRoles(token = this.getSessionToken(), tenant?: string) {\n\t\tif (token === null) {\n\t\t\tconsole.error('Could not get JWT Roles - not authenticated');\n\t\t\treturn [];\n\t\t}\n\t\treturn this.descopeSdk.getJwtRoles(token, tenant);\n\t}\n\n\tisAuthenticated() {\n\t\treturn this.sessionSubject.value.isAuthenticated;\n\t}\n\n\tprivate setSession(sessionToken: string | null) {\n\t\tconst currentSession = this.sessionSubject.value;\n\t\tthis.sessionSubject.next({\n\t\t\tsessionToken,\n\t\t\tisAuthenticated: !!sessionToken,\n\t\t\tisSessionLoading: currentSession.isSessionLoading\n\t\t});\n\t}\n\n\tprivate setUser(user: UserResponse) {\n\t\tconst currentUser = this.userSubject.value;\n\t\tthis.userSubject.next({\n\t\t\tisUserLoading: currentUser.isUserLoading,\n\t\t\tuser\n\t\t});\n\t}\n}\n","import { inject } from '@angular/core';\n\nimport { DescopeAuthService } from './descope-auth.service';\nimport { ActivatedRouteSnapshot, Router } from '@angular/router';\nimport { from, of } from 'rxjs';\n\nexport const descopeAuthGuard = (route: ActivatedRouteSnapshot) => {\n\tconst authService = inject(DescopeAuthService);\n\tconst router = inject(Router);\n\tconst fallbackUrl = route.data['descopeFallbackUrl'];\n\tconst isAuthenticated = authService.isAuthenticated();\n\tif (!isAuthenticated && !!fallbackUrl) {\n\t\treturn from(router.navigate([fallbackUrl]));\n\t}\n\treturn of(isAuthenticated);\n};\n","import { inject } from '@angular/core';\nimport {\n\tHttpErrorResponse,\n\tHttpHandlerFn,\n\tHttpInterceptorFn,\n\tHttpRequest\n} from '@angular/common/http';\nimport { throwError } from 'rxjs';\nimport { catchError, switchMap } from 'rxjs/operators';\nimport { DescopeAuthService } from './descope-auth.service';\nimport { DescopeAuthConfig } from '../types/types';\n\nexport const descopeInterceptor: HttpInterceptorFn = (request, next) => {\n\tconst config = inject(DescopeAuthConfig);\n\tconst authService = inject(DescopeAuthService);\n\n\tfunction refreshAndRetry(\n\t\trequest: HttpRequest<unknown>,\n\t\tnext: HttpHandlerFn,\n\t\terror?: HttpErrorResponse\n\t) {\n\t\treturn authService.refreshSession().pipe(\n\t\t\tswitchMap((refreshed) => {\n\t\t\t\tif (refreshed.ok && refreshed.data) {\n\t\t\t\t\tconst requestWithRefreshedToken = addTokenToRequest(\n\t\t\t\t\t\trequest,\n\t\t\t\t\t\trefreshed.data?.sessionJwt\n\t\t\t\t\t);\n\t\t\t\t\treturn next(requestWithRefreshedToken);\n\t\t\t\t} else {\n\t\t\t\t\treturn throwError(\n\t\t\t\t\t\t() => error ?? new Error('Could not refresh session!')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\t}\n\n\tfunction shouldIntercept(request: HttpRequest<unknown>): boolean {\n\t\treturn (\n\t\t\t(config.pathsToIntercept?.length === 0 ||\n\t\t\t\tconfig.pathsToIntercept?.some((path) => request.url.includes(path))) ??\n\t\t\ttrue\n\t\t);\n\t}\n\n\tfunction addTokenToRequest(\n\t\trequest: HttpRequest<unknown>,\n\t\ttoken: string\n\t): HttpRequest<unknown> {\n\t\treturn request.clone({\n\t\t\tsetHeaders: {\n\t\t\t\tAuthorization: `Bearer ${token}`\n\t\t\t}\n\t\t});\n\t}\n\n\tif (shouldIntercept(request)) {\n\t\tconst token = authService.getSessionToken();\n\t\tif (!token) {\n\t\t\treturn refreshAndRetry(request, next);\n\t\t}\n\t\tconst requestWithToken = addTokenToRequest(request, token);\n\t\treturn next(requestWithToken).pipe(\n\t\t\tcatchError((error: HttpErrorResponse) => {\n\t\t\t\tif (error.status === 401 || error.status === 403) {\n\t\t\t\t\treturn refreshAndRetry(request, next, error);\n\t\t\t\t} else {\n\t\t\t\t\treturn throwError(() => error);\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\t} else {\n\t\treturn next(request);\n\t}\n};\n","import {\n\tComponent,\n\tElementRef,\n\tEventEmitter,\n\tInput,\n\tOnChanges,\n\tOnInit,\n\tOutput\n} from '@angular/core';\nimport DescopeWebComponent from '@descope/web-component';\nimport DescopeWc, { ILogger } from '@descope/web-component';\nimport { DescopeAuthService } from '../../services/descope-auth.service';\nimport { from } from 'rxjs';\nimport { baseHeaders } from '../../utils/constants';\nimport { DescopeAuthConfig } from '../../types/types';\n\n@Component({\n\tselector: 'descope[flowId]',\n\tstandalone: true,\n\ttemplate: ''\n})\nexport class DescopeComponent implements OnInit, OnChanges {\n\tprojectId: string;\n\t@Input() flowId: string;\n\n\t@Input() locale: string;\n\t@Input() theme: 'light' | 'dark' | 'os';\n\t@Input() tenant: string;\n\t@Input() telemetryKey: string;\n\t@Input() redirectUrl: string;\n\t@Input() autoFocus: true | false | 'skipFirstScreen';\n\n\t@Input() debug: boolean;\n\t@Input() errorTransformer: (error: { text: string; type: string }) => string;\n\t@Input() logger: ILogger;\n\n\t@Output() success: EventEmitter<void> = new EventEmitter<void>();\n\t@Output() error: EventEmitter<void> = new EventEmitter<void>();\n\n\tprivate readonly webComponent: DescopeWebComponent =\n\t\tnew DescopeWebComponent();\n\n\tconstructor(\n\t\tprivate elementRef: ElementRef,\n\t\tprivate authService: DescopeAuthService,\n\t\tdescopeConfig: DescopeAuthConfig\n\t) {\n\t\tthis.projectId = descopeConfig.projectId;\n\t}\n\n\tngOnInit() {\n\t\tDescopeWc.sdkConfigOverrides = { baseHeaders };\n\t\tthis.setupWebComponent();\n\t\tthis.elementRef.nativeElement.appendChild(this.webComponent);\n\t}\n\n\tngOnChanges(): void {\n\t\tthis.setupWebComponent();\n\t}\n\n\tprivate setupWebComponent() {\n\t\tthis.webComponent.setAttribute('project-id', this.projectId);\n\t\tthis.webComponent.setAttribute('flow-id', this.flowId);\n\t\tif (this.locale) {\n\t\t\tthis.webComponent.setAttribute('locale', this.locale);\n\t\t}\n\t\tif (this.theme) {\n\t\t\tthis.webComponent.setAttribute('theme', this.theme);\n\t\t}\n\t\tif (this.tenant) {\n\t\t\tthis.webComponent.setAttribute('tenant', this.tenant);\n\t\t}\n\t\tif (this.telemetryKey) {\n\t\t\tthis.webComponent.setAttribute('telemetryKey', this.telemetryKey);\n\t\t}\n\t\tif (this.redirectUrl) {\n\t\t\tthis.webComponent.setAttribute('redirect-url', this.redirectUrl);\n\t\t}\n\t\tif (this.autoFocus) {\n\t\t\tthis.webComponent.setAttribute('auto-focus', this.autoFocus.toString());\n\t\t}\n\t\tif (this.debug) {\n\t\t\tthis.webComponent.setAttribute('debug', this.debug.toString());\n\t\t}\n\n\t\tif (this.errorTransformer) {\n\t\t\tthis.webComponent.errorTransformer = this.errorTransformer;\n\t\t}\n\n\t\tif (this.logger) {\n\t\t\tthis.webComponent.logger = this.logger;\n\t\t}\n\n\t\tif (this.success) {\n\t\t\tthis.webComponent.addEventListener('success', (e: Event) => {\n\t\t\t\tfrom(\n\t\t\t\t\tthis.authService.descopeSdk.httpClient.hooks?.afterRequest!(\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t{} as any,\n\t\t\t\t\t\tnew Response(JSON.stringify((e as CustomEvent).detail))\n\t\t\t\t\t) as Promise<unknown>\n\t\t\t\t).subscribe(() => {\n\t\t\t\t\tthis.success?.emit();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tif (this.error) {\n\t\t\tthis.webComponent.addEventListener('error', () => {\n\t\t\t\tthis.error?.emit();\n\t\t\t});\n\t\t}\n\t}\n}\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { ILogger } from '@descope/web-component';\nimport { DescopeComponent } from '../descope/descope.component';\nimport { DescopeAuthConfig } from '../../types/types';\n\n@Component({\n\tselector: 'descope-sign-in-flow',\n\tstandalone: true,\n\timports: [DescopeComponent],\n\ttemplateUrl: './sign-in-flow.component.html'\n})\nexport class SignInFlowComponent {\n\tprojectId: string;\n\n\t@Input() locale: string;\n\t@Input() theme: 'light' | 'dark' | 'os';\n\t@Input() tenant: string;\n\t@Input() telemetryKey: string;\n\t@Input() redirectUrl: string;\n\t@Input() autoFocus: true | false | 'skipFirstScreen';\n\n\t@Input() debug: boolean;\n\t@Input() errorTransformer: (error: { text: string; type: string }) => string;\n\t@Input() logger: ILogger;\n\n\t@Output() success: EventEmitter<void> = new EventEmitter<void>();\n\t@Output() error: EventEmitter<void> = new EventEmitter<void>();\n\n\tconstructor(descopeConfig: DescopeAuthConfig) {\n\t\tthis.projectId = descopeConfig.projectId;\n\t}\n}\n","<descope\n\t(success)=\"success.emit()\"\n\t(error)=\"error.emit()\"\n\tflowId=\"sign-in\"\n\t[locale]=\"locale\"\n\t[theme]=\"theme\"\n\t[tenant]=\"tenant\"\n\t[telemetryKey]=\"telemetryKey\"\n\t[redirectUrl]=\"redirectUrl\"\n\t[autoFocus]=\"autoFocus\"\n\t[debug]=\"debug\"\n\t[errorTransformer]=\"errorTransformer\"\n\t[logger]=\"logger\"\n>\n</descope>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { ILogger } from '@descope/web-component';\nimport { DescopeComponent } from '../descope/descope.component';\nimport { DescopeAuthConfig } from '../../types/types';\n\n@Component({\n\tselector: 'descope-sign-up-flow',\n\tstandalone: true,\n\timports: [DescopeComponent],\n\ttemplateUrl: './sign-up-flow.component.html'\n})\nexport class SignUpFlowComponent {\n\tprojectId: string;\n\n\t@Input() locale: string;\n\t@Input() theme: 'light' | 'dark' | 'os';\n\t@Input() tenant: string;\n\t@Input() telemetryKey: string;\n\t@Input() redirectUrl: string;\n\t@Input() autoFocus: true | false | 'skipFirstScreen';\n\n\t@Input() debug: boolean;\n\t@Input() errorTransformer: (error: { text: string; type: string }) => string;\n\t@Input() logger: ILogger;\n\n\t@Output() success: EventEmitter<void> = new EventEmitter<void>();\n\t@Output() error: EventEmitter<void> = new EventEmitter<void>();\n\n\tconstructor(descopeConfig: DescopeAuthConfig) {\n\t\tthis.projectId = descopeConfig.projectId;\n\t}\n}\n","<descope\n\t(success)=\"success.emit()\"\n\t(error)=\"error.emit()\"\n\tflowId=\"sign-up\"\n\t[locale]=\"locale\"\n\t[theme]=\"theme\"\n\t[tenant]=\"tenant\"\n\t[telemetryKey]=\"telemetryKey\"\n\t[redirectUrl]=\"redirectUrl\"\n\t[autoFocus]=\"autoFocus\"\n\t[debug]=\"debug\"\n\t[errorTransformer]=\"errorTransformer\"\n\t[logger]=\"logger\"\n>\n</descope>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { ILogger } from '@descope/web-component';\nimport { DescopeComponent } from '../descope/descope.component';\nimport { DescopeAuthConfig } from '../../types/types';\n\n@Component({\n\tselector: 'descope-sign-up-or-in-flow',\n\tstandalone: true,\n\timports: [DescopeComponent],\n\ttemplateUrl: './sign-up-or-in-flow.component.html'\n})\nexport class SignUpOrInFlowComponent {\n\tprojectId: string;\n\n\t@Input() locale: string;\n\t@Input() theme: 'light' | 'dark' | 'os';\n\t@Input() tenant: string;\n\t@Input() telemetryKey: string;\n\t@Input() redirectUrl: string;\n\t@Input() autoFocus: true | false | 'skipFirstScreen';\n\n\t@Input() debug: boolean;\n\t@Input() errorTransformer: (error: { text: string; type: string }) => string;\n\t@Input() logger: ILogger;\n\n\t@Output() success: EventEmitter<void> = new EventEmitter<void>();\n\t@Output() error: EventEmitter<void> = new EventEmitter<void>();\n\n\tconstructor(descopeConfig: DescopeAuthConfig) {\n\t\tthis.projectId = descopeConfig.projectId;\n\t}\n}\n","<descope\n\t(success)=\"success.emit()\"\n\t(error)=\"error.emit()\"\n\tflowId=\"sign-up-or-in\"\n\t[locale]=\"locale\"\n\t[theme]=\"theme\"\n\t[tenant]=\"tenant\"\n\t[telemetryKey]=\"telemetryKey\"\n\t[redirectUrl]=\"redirectUrl\"\n\t[autoFocus]=\"autoFocus\"\n\t[debug]=\"debug\"\n\t[errorTransformer]=\"errorTransformer\"\n\t[logger]=\"logger\"\n>\n</descope>\n","import {\n\tCUSTOM_ELEMENTS_SCHEMA,\n\tModuleWithProviders,\n\tNgModule,\n\tOptional,\n\tSkipSelf\n} from '@angular/core';\nimport { DescopeComponent } from './components/descope/descope.component';\nimport { SignInFlowComponent } from './components/sign-in-flow/sign-in-flow.component';\nimport { SignUpFlowComponent } from './components/sign-up-flow/sign-up-flow.component';\nimport { SignUpOrInFlowComponent } from './components/sign-up-or-in-flow/sign-up-or-in-flow.component';\nimport { DescopeAuthConfig } from './types/types';\n\n@NgModule({\n\tschemas: [CUSTOM_ELEMENTS_SCHEMA],\n\timports: [\n\t\tDescopeComponent,\n\t\tSignInFlowComponent,\n\t\tSignUpFlowComponent,\n\t\tSignUpOrInFlowComponent\n\t],\n\texports: [\n\t\tDescopeComponent,\n\t\tSignInFlowComponent,\n\t\tSignUpFlowComponent,\n\t\tSignUpOrInFlowComponent\n\t]\n})\nexport class DescopeAuthModule {\n\tconstructor(@Optional() @SkipSelf() parentModule?: DescopeAuthModule) {\n\t\tif (parentModule) {\n\t\t\tthrow new Error(\n\t\t\t\t'DescopeAuthModule is already loaded. Import it only once'\n\t\t\t);\n\t\t}\n\t}\n\n\tstatic forRoot(\n\t\tconfig?: DescopeAuthConfig\n\t): ModuleWithProviders<DescopeAuthModule> {\n\t\treturn {\n\t\t\tngModule: DescopeAuthModule,\n\t\t\tproviders: [{ provide: DescopeAuthConfig, useValue: config }]\n\t\t};\n\t}\n}\n","/*\n * Public API Surface of angular-sdk\n */\n\nexport * from './lib/services/descope-auth.service';\nexport * from './lib/services/descope-auth.guard';\nexport * from './lib/services/descope.interceptor';\nexport * from './lib/descope-auth.module';\nexport * from './lib/components/descope/descope.component';\nexport * from './lib/components/sign-in-flow/sign-in-flow.component';\nexport * from './lib/components/sign-up-flow/sign-up-flow.component';\nexport * from './lib/components/sign-up-or-in-flow/sign-up-or-in-flow.component';\nexport * from './lib/types/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DescopeAuthConfig","DescopeWc","i1.DescopeAuthService","i2.DescopeAuthConfig"],"m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CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAZ5B,gBAAgB;YAChB,mBAAmB;YACnB,mBAAmB;AACnB,YAAA,uBAAuB,aAGvB,gBAAgB;YAChB,mBAAmB;YACnB,mBAAmB;YACnB,uBAAuB,CAAA,EAAA,CAAA,CAAA,EAAA;+GAGZ,iBAAiB,EAAA,CAAA,CAAA,EAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAf7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACR,gBAAgB;wBAChB,mBAAmB;wBACnB,mBAAmB;wBACnB,uBAAuB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACR,gBAAgB;wBAChB,mBAAmB;wBACnB,mBAAmB;wBACnB,uBAAuB;AACvB,qBAAA;AACD,iBAAA,CAAA;;0BAEa,QAAQ;;0BAAI,QAAQ;;;AC7BlC;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ElementRef, EventEmitter, OnChanges, OnInit } from '@angular/core';
|
|
2
|
+
import { ILogger } from '@descope/web-component';
|
|
3
|
+
import { DescopeAuthService } from '../../services/descope-auth.service';
|
|
4
|
+
import { DescopeAuthConfig } from '../../types/types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class DescopeComponent implements OnInit, OnChanges {
|
|
7
|
+
private elementRef;
|
|
8
|
+
private authService;
|
|
9
|
+
projectId: string;
|
|
10
|
+
flowId: string;
|
|
11
|
+
locale: string;
|
|
12
|
+
theme: 'light' | 'dark' | 'os';
|
|
13
|
+
tenant: string;
|
|
14
|
+
telemetryKey: string;
|
|
15
|
+
redirectUrl: string;
|
|
16
|
+
autoFocus: true | false | 'skipFirstScreen';
|
|
17
|
+
debug: boolean;
|
|
18
|
+
errorTransformer: (error: {
|
|
19
|
+
text: string;
|
|
20
|
+
type: string;
|
|
21
|
+
}) => string;
|
|
22
|
+
logger: ILogger;
|
|
23
|
+
success: EventEmitter<void>;
|
|
24
|
+
error: EventEmitter<void>;
|
|
25
|
+
private readonly webComponent;
|
|
26
|
+
constructor(elementRef: ElementRef, authService: DescopeAuthService, descopeConfig: DescopeAuthConfig);
|
|
27
|
+
ngOnInit(): void;
|
|
28
|
+
ngOnChanges(): void;
|
|
29
|
+
private setupWebComponent;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DescopeComponent, never>;
|
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DescopeComponent, "descope[flowId]", never, { "flowId": { "alias": "flowId"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "tenant": { "alias": "tenant"; "required": false; }; "telemetryKey": { "alias": "telemetryKey"; "required": false; }; "redirectUrl": { "alias": "redirectUrl"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; "errorTransformer": { "alias": "errorTransformer"; "required": false; }; "logger": { "alias": "logger"; "required": false; }; }, { "success": "success"; "error": "error"; }, never, never, true, never>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ILogger } from '@descope/web-component';
|
|
3
|
+
import { DescopeAuthConfig } from '../../types/types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class SignInFlowComponent {
|
|
6
|
+
projectId: string;
|
|
7
|
+
locale: string;
|
|
8
|
+
theme: 'light' | 'dark' | 'os';
|
|
9
|
+
tenant: string;
|
|
10
|
+
telemetryKey: string;
|
|
11
|
+
redirectUrl: string;
|
|
12
|
+
autoFocus: true | false | 'skipFirstScreen';
|
|
13
|
+
debug: boolean;
|
|
14
|
+
errorTransformer: (error: {
|
|
15
|
+
text: string;
|
|
16
|
+
type: string;
|
|
17
|
+
}) => string;
|
|
18
|
+
logger: ILogger;
|
|
19
|
+
success: EventEmitter<void>;
|
|
20
|
+
error: EventEmitter<void>;
|
|
21
|
+
constructor(descopeConfig: DescopeAuthConfig);
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SignInFlowComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SignInFlowComponent, "descope-sign-in-flow", never, { "locale": { "alias": "locale"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "tenant": { "alias": "tenant"; "required": false; }; "telemetryKey": { "alias": "telemetryKey"; "required": false; }; "redirectUrl": { "alias": "redirectUrl"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; "errorTransformer": { "alias": "errorTransformer"; "required": false; }; "logger": { "alias": "logger"; "required": false; }; }, { "success": "success"; "error": "error"; }, never, never, true, never>;
|
|
24
|
+
}
|