@strivacity/sdk-angular 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # 1.0.0 (2024-09-20)
2
+
3
+
4
+ ### 🚀 Features
5
+
6
+ - @strivacity/sdk-angular package implemented
7
+
8
+
9
+ ### 🧱 Updated Dependencies
10
+
11
+ - Updated sdk-core to 1.0.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Strivacity Inc. <info@strivacity.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,238 @@
1
+ # @strivacity/sdk-angular
2
+
3
+ > **The SDK supports Angular version 16 and above**
4
+
5
+ ### Install
6
+
7
+ ```bash
8
+ npm install @strivacity/sdk-angular
9
+ ```
10
+
11
+ ### Usage
12
+
13
+ #### NgModule - Import `StrivacityAuthModule` to your application:
14
+
15
+ `app.module.ts`
16
+
17
+ ```ts
18
+ import { NgModule } from '@angular/core';
19
+
20
+ import { AppComponent } from './app.component';
21
+ import { StrivacityAuthModule } from '@strivacity/angular-sdk';
22
+
23
+ @NgModule({
24
+ declarations: [AppComponent],
25
+ imports: [
26
+ ...StrivacityAuthModule.forRoot({
27
+ issuer: 'https://<YOUR_DOMAIN>',
28
+ scopes: ['openid', 'profile'],
29
+ clientId: '<YOUR_CLIENT_ID>',
30
+ redirectUri: '<YOUR_REDIRECT_URI>',
31
+ }),
32
+ ],
33
+ bootstrap: [AppComponent],
34
+ })
35
+ export class AppModule {}
36
+ ```
37
+
38
+ #### Standalone mode - Configure SDK for your application:
39
+
40
+ `app.config.ts`
41
+
42
+ ```ts
43
+ import { ApplicationConfig } from '@angular/core';
44
+ import { provideStrivacity } from '@strivacity/sdk-angular';
45
+
46
+ export const appConfig: ApplicationConfig = {
47
+ providers: [
48
+ ...provideStrivacity({
49
+ issuer: 'https://<YOUR_DOMAIN>',
50
+ scopes: ['openid', 'profile'],
51
+ clientId: '<YOUR_CLIENT_ID>',
52
+ redirectUri: '<YOUR_REDIRECT_URI>',
53
+ }),
54
+ ],
55
+ };
56
+ ```
57
+
58
+ #### NgModule - How to use the SDK in your components:
59
+
60
+ `app.component.html`
61
+
62
+ ```text
63
+ @if (isAuthenticated) {
64
+ <div>Welcome, {{ name }}!</div>
65
+ <button @click="logout()">Logout</button>
66
+ } @else {
67
+ <div>Not logged in</div>
68
+ <button @click="login()">Log in</button>
69
+ }
70
+ ```
71
+
72
+ `app.component.ts`
73
+
74
+ ```ts
75
+ import { Component } from '@angular/core';
76
+ import { Router } from '@angular/router';
77
+ import { StrivacityAuthService } from '@strivacity/sdk-angular';
78
+
79
+ @Component({
80
+ selector: 'app-root',
81
+ templateUrl: './app.component.html',
82
+ styleUrls: ['./app.component.scss'],
83
+ })
84
+ export class AppComponent {
85
+ isAuthenticated = false;
86
+ name = '';
87
+
88
+ constructor(
89
+ protected router: Router,
90
+ protected strivacityAuthService: StrivacityAuthService,
91
+ ) {
92
+ this.strivacityAuthService.session$.subscribe((session) => {
93
+ this.isAuthenticated = session.isAuthenticated;
94
+ this.name = `${session.idTokenClaims?.given_name} ${session.idTokenClaims?.family_name}`;
95
+ });
96
+ }
97
+
98
+ login(): void {
99
+ this.strivacityAuthService.login().subscribe({
100
+ next: () => {
101
+ this.router.navigateByUrl('/profile');
102
+ },
103
+ });
104
+ }
105
+
106
+ logout(): void {
107
+ this.strivacityAuthService.logout().subscribe({
108
+ next: () => {
109
+ this.router.navigateByUrl('/');
110
+ },
111
+ });
112
+ }
113
+ }
114
+ ```
115
+
116
+ #### Standalone mode - How to use the SDK in your components:
117
+
118
+ Everything in the SDK are standalone, so you can use them by directly importing them to your components.
119
+
120
+ ### API Documentation
121
+
122
+ #### `StrivacityAuthService`
123
+
124
+ Service that manages Strivacity authentication flows. Supports either `PopupFlow` or `RedirectFlow` types.
125
+
126
+ **Constructor**
127
+
128
+ ```typescript
129
+ constructor(@Inject(STRIVACITY_SDK) public options: Options);
130
+ ```
131
+
132
+ - `options`: SDK configuration options.
133
+
134
+ **Properties**
135
+
136
+ - **`session$`**: An observable that emits the current authentication session state. It provides updates on the authentication status, token information, and other relevant session details.
137
+
138
+ **Session Object Structure**:
139
+
140
+ ```typescript
141
+ interface Session = {
142
+ /**
143
+ * Indicates whether the session is in the process of loading or initializing.
144
+ * When `true`, the session information might not be fully available yet.
145
+ */
146
+ loading: boolean;
147
+
148
+ /**
149
+ * Indicates whether the user is currently authenticated.
150
+ * `true` if the user is authenticated, otherwise `false`.
151
+ */
152
+ isAuthenticated: boolean;
153
+
154
+ /**
155
+ * The claims contained in the ID token if the user is authenticated.
156
+ * This includes information such as the user's identity and authentication context.
157
+ * If the user is not authenticated, this will be `null`.
158
+ */
159
+ idTokenClaims: IdTokenClaims | null;
160
+
161
+ /**
162
+ * The current access token used for authorizing API requests.
163
+ * This token is `null` if the user is not authenticated or if the token has not been set.
164
+ */
165
+ accessToken: string | null;
166
+
167
+ /**
168
+ * The current refresh token used to obtain a new access token when the current one expires.
169
+ * This token is `null` if the user is not authenticated or if the token has not been set.
170
+ */
171
+ refreshToken: string | null;
172
+
173
+ /**
174
+ * Indicates whether the current access token has expired.
175
+ * `true` if the token is expired, otherwise `false`.
176
+ */
177
+ accessTokenExpired: boolean;
178
+
179
+ /**
180
+ * The expiration date of the current access token in Unix time (milliseconds since epoch).
181
+ * If the access token is not available or the session is not authenticated, this will be `null`.
182
+ */
183
+ accessTokenExpirationDate: number | null;
184
+ };
185
+ ```
186
+
187
+ **Emits**:
188
+
189
+ - **Initial State**: When the service is initialized, `session$` will emit an initial state with `loading: true` and other properties set to default or `null` values.
190
+ - **State Changes**: As authentication events occur (e.g., login, logout, token refresh), `session$` will emit updated session states reflecting the current authentication status and token details.
191
+
192
+ **Methods**
193
+
194
+ - **`isAuthenticated()`**: Checks if the user is authenticated.
195
+
196
+ ```typescript
197
+ isAuthenticated(): Observable<boolean>;
198
+ ```
199
+
200
+ - **`login(options?: Parameters<Flow['login']>[0])`**: Logs the user in using the specified options.
201
+
202
+ ```typescript
203
+ login(options?: Parameters<Flow['login']>[0]): Observable<void>;
204
+ ```
205
+
206
+ - **`register(options?: Parameters<Flow['register']>[0])`**: Registers a new user using the specified options.
207
+
208
+ ```typescript
209
+ register(options?: Parameters<Flow['register']>[0]): Observable<void>;
210
+ ```
211
+
212
+ - **`refresh()`**: Refreshes the current authentication session.
213
+
214
+ ```typescript
215
+ refresh(): Observable<void>;
216
+ ```
217
+
218
+ - **`revoke()`**: Revokes the current session tokens.
219
+
220
+ ```typescript
221
+ revoke(): Observable<void>;
222
+ ```
223
+
224
+ - **`logout(options?: Parameters<Flow['logout']>[0])`**: Logs the user out using the specified options.
225
+
226
+ ```typescript
227
+ logout(options?: Parameters<Flow['logout']>[0]): Observable<void>;
228
+ ```
229
+
230
+ - **`handleCallback(url?: Parameters<Flow['handleCallback']>[0])`**: Handles the authentication callback (e.g., after a redirect or popup flow).
231
+
232
+ ```typescript
233
+ handleCallback(url?: Parameters<Flow['handleCallback']>[0]): Observable<void>;
234
+ ```
235
+
236
+ ### Links
237
+
238
+ [Example app](https://github.com/Strivacity/sdk-js/tree/main/apps/angular)
package/dist/README.md ADDED
@@ -0,0 +1,238 @@
1
+ # @strivacity/sdk-angular
2
+
3
+ > **The SDK supports Angular version 16 and above**
4
+
5
+ ### Install
6
+
7
+ ```bash
8
+ npm install @strivacity/sdk-angular
9
+ ```
10
+
11
+ ### Usage
12
+
13
+ #### NgModule - Import `StrivacityAuthModule` to your application:
14
+
15
+ `app.module.ts`
16
+
17
+ ```ts
18
+ import { NgModule } from '@angular/core';
19
+
20
+ import { AppComponent } from './app.component';
21
+ import { StrivacityAuthModule } from '@strivacity/angular-sdk';
22
+
23
+ @NgModule({
24
+ declarations: [AppComponent],
25
+ imports: [
26
+ ...StrivacityAuthModule.forRoot({
27
+ issuer: 'https://<YOUR_DOMAIN>',
28
+ scopes: ['openid', 'profile'],
29
+ clientId: '<YOUR_CLIENT_ID>',
30
+ redirectUri: '<YOUR_REDIRECT_URI>',
31
+ }),
32
+ ],
33
+ bootstrap: [AppComponent],
34
+ })
35
+ export class AppModule {}
36
+ ```
37
+
38
+ #### Standalone mode - Configure SDK for your application:
39
+
40
+ `app.config.ts`
41
+
42
+ ```ts
43
+ import { ApplicationConfig } from '@angular/core';
44
+ import { provideStrivacity } from '@strivacity/sdk-angular';
45
+
46
+ export const appConfig: ApplicationConfig = {
47
+ providers: [
48
+ ...provideStrivacity({
49
+ issuer: 'https://<YOUR_DOMAIN>',
50
+ scopes: ['openid', 'profile'],
51
+ clientId: '<YOUR_CLIENT_ID>',
52
+ redirectUri: '<YOUR_REDIRECT_URI>',
53
+ }),
54
+ ],
55
+ };
56
+ ```
57
+
58
+ #### NgModule - How to use the SDK in your components:
59
+
60
+ `app.component.html`
61
+
62
+ ```text
63
+ @if (isAuthenticated) {
64
+ <div>Welcome, {{ name }}!</div>
65
+ <button @click="logout()">Logout</button>
66
+ } @else {
67
+ <div>Not logged in</div>
68
+ <button @click="login()">Log in</button>
69
+ }
70
+ ```
71
+
72
+ `app.component.ts`
73
+
74
+ ```ts
75
+ import { Component } from '@angular/core';
76
+ import { Router } from '@angular/router';
77
+ import { StrivacityAuthService } from '@strivacity/sdk-angular';
78
+
79
+ @Component({
80
+ selector: 'app-root',
81
+ templateUrl: './app.component.html',
82
+ styleUrls: ['./app.component.scss'],
83
+ })
84
+ export class AppComponent {
85
+ isAuthenticated = false;
86
+ name = '';
87
+
88
+ constructor(
89
+ protected router: Router,
90
+ protected strivacityAuthService: StrivacityAuthService,
91
+ ) {
92
+ this.strivacityAuthService.session$.subscribe((session) => {
93
+ this.isAuthenticated = session.isAuthenticated;
94
+ this.name = `${session.idTokenClaims?.given_name} ${session.idTokenClaims?.family_name}`;
95
+ });
96
+ }
97
+
98
+ login(): void {
99
+ this.strivacityAuthService.login().subscribe({
100
+ next: () => {
101
+ this.router.navigateByUrl('/profile');
102
+ },
103
+ });
104
+ }
105
+
106
+ logout(): void {
107
+ this.strivacityAuthService.logout().subscribe({
108
+ next: () => {
109
+ this.router.navigateByUrl('/');
110
+ },
111
+ });
112
+ }
113
+ }
114
+ ```
115
+
116
+ #### Standalone mode - How to use the SDK in your components:
117
+
118
+ Everything in the SDK are standalone, so you can use them by directly importing them to your components.
119
+
120
+ ### API Documentation
121
+
122
+ #### `StrivacityAuthService`
123
+
124
+ Service that manages Strivacity authentication flows. Supports either `PopupFlow` or `RedirectFlow` types.
125
+
126
+ **Constructor**
127
+
128
+ ```typescript
129
+ constructor(@Inject(STRIVACITY_SDK) public options: Options);
130
+ ```
131
+
132
+ - `options`: SDK configuration options.
133
+
134
+ **Properties**
135
+
136
+ - **`session$`**: An observable that emits the current authentication session state. It provides updates on the authentication status, token information, and other relevant session details.
137
+
138
+ **Session Object Structure**:
139
+
140
+ ```typescript
141
+ interface Session = {
142
+ /**
143
+ * Indicates whether the session is in the process of loading or initializing.
144
+ * When `true`, the session information might not be fully available yet.
145
+ */
146
+ loading: boolean;
147
+
148
+ /**
149
+ * Indicates whether the user is currently authenticated.
150
+ * `true` if the user is authenticated, otherwise `false`.
151
+ */
152
+ isAuthenticated: boolean;
153
+
154
+ /**
155
+ * The claims contained in the ID token if the user is authenticated.
156
+ * This includes information such as the user's identity and authentication context.
157
+ * If the user is not authenticated, this will be `null`.
158
+ */
159
+ idTokenClaims: IdTokenClaims | null;
160
+
161
+ /**
162
+ * The current access token used for authorizing API requests.
163
+ * This token is `null` if the user is not authenticated or if the token has not been set.
164
+ */
165
+ accessToken: string | null;
166
+
167
+ /**
168
+ * The current refresh token used to obtain a new access token when the current one expires.
169
+ * This token is `null` if the user is not authenticated or if the token has not been set.
170
+ */
171
+ refreshToken: string | null;
172
+
173
+ /**
174
+ * Indicates whether the current access token has expired.
175
+ * `true` if the token is expired, otherwise `false`.
176
+ */
177
+ accessTokenExpired: boolean;
178
+
179
+ /**
180
+ * The expiration date of the current access token in Unix time (milliseconds since epoch).
181
+ * If the access token is not available or the session is not authenticated, this will be `null`.
182
+ */
183
+ accessTokenExpirationDate: number | null;
184
+ };
185
+ ```
186
+
187
+ **Emits**:
188
+
189
+ - **Initial State**: When the service is initialized, `session$` will emit an initial state with `loading: true` and other properties set to default or `null` values.
190
+ - **State Changes**: As authentication events occur (e.g., login, logout, token refresh), `session$` will emit updated session states reflecting the current authentication status and token details.
191
+
192
+ **Methods**
193
+
194
+ - **`isAuthenticated()`**: Checks if the user is authenticated.
195
+
196
+ ```typescript
197
+ isAuthenticated(): Observable<boolean>;
198
+ ```
199
+
200
+ - **`login(options?: Parameters<Flow['login']>[0])`**: Logs the user in using the specified options.
201
+
202
+ ```typescript
203
+ login(options?: Parameters<Flow['login']>[0]): Observable<void>;
204
+ ```
205
+
206
+ - **`register(options?: Parameters<Flow['register']>[0])`**: Registers a new user using the specified options.
207
+
208
+ ```typescript
209
+ register(options?: Parameters<Flow['register']>[0]): Observable<void>;
210
+ ```
211
+
212
+ - **`refresh()`**: Refreshes the current authentication session.
213
+
214
+ ```typescript
215
+ refresh(): Observable<void>;
216
+ ```
217
+
218
+ - **`revoke()`**: Revokes the current session tokens.
219
+
220
+ ```typescript
221
+ revoke(): Observable<void>;
222
+ ```
223
+
224
+ - **`logout(options?: Parameters<Flow['logout']>[0])`**: Logs the user out using the specified options.
225
+
226
+ ```typescript
227
+ logout(options?: Parameters<Flow['logout']>[0]): Observable<void>;
228
+ ```
229
+
230
+ - **`handleCallback(url?: Parameters<Flow['handleCallback']>[0])`**: Handles the authentication callback (e.g., after a redirect or popup flow).
231
+
232
+ ```typescript
233
+ handleCallback(url?: Parameters<Flow['handleCallback']>[0]): Observable<void>;
234
+ ```
235
+
236
+ ### Links
237
+
238
+ [Example app](https://github.com/Strivacity/sdk-js/tree/main/apps/angular)
@@ -0,0 +1,141 @@
1
+ import { Inject, Injectable } from '@angular/core';
2
+ import { BehaviorSubject, from } from 'rxjs';
3
+ import { initFlow } from '@strivacity/sdk-core';
4
+ import { STRIVACITY_SDK } from '../utils/helpers';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Service that manages Strivacity authentication flows.
8
+ * Supports either PopupFlow or RedirectFlow types.
9
+ *
10
+ * @template Flow Type of authentication flow (PopupFlow or RedirectFlow).
11
+ * @template Options Type of SDK options (defaults to SDKOptions).
12
+ */
13
+ export class StrivacityAuthService {
14
+ options;
15
+ /**
16
+ * Instance of the authentication flow (PopupFlow or RedirectFlow).
17
+ * @protected
18
+ */
19
+ sdk;
20
+ /**
21
+ * BehaviorSubject that holds the current session state.
22
+ * @protected
23
+ * @readonly
24
+ */
25
+ sessionSubject;
26
+ /**
27
+ * Observable that emits the session state changes.
28
+ * @readonly
29
+ */
30
+ session$;
31
+ /**
32
+ * Creates an instance of StrivacityAuthService.
33
+ *
34
+ * @param {Options} options SDK configuration options injected via STRIVACITY_SDK.
35
+ */
36
+ constructor(options) {
37
+ this.options = options;
38
+ this.sdk = initFlow(options);
39
+ this.sessionSubject = new BehaviorSubject({
40
+ loading: true,
41
+ isAuthenticated: false,
42
+ idTokenClaims: null,
43
+ accessToken: null,
44
+ refreshToken: null,
45
+ accessTokenExpired: true,
46
+ accessTokenExpirationDate: null,
47
+ });
48
+ this.session$ = this.sessionSubject.asObservable();
49
+ const updateSession = async () => {
50
+ this.sessionSubject.next({
51
+ loading: false,
52
+ isAuthenticated: await this.sdk.isAuthenticated,
53
+ idTokenClaims: this.sdk.idTokenClaims || null,
54
+ accessToken: this.sdk.accessToken || null,
55
+ refreshToken: this.sdk.refreshToken || null,
56
+ accessTokenExpired: this.sdk.accessTokenExpired,
57
+ accessTokenExpirationDate: this.sdk.accessTokenExpirationDate || null,
58
+ });
59
+ };
60
+ this.sdk.subscribeToEvent('init', updateSession);
61
+ this.sdk.subscribeToEvent('loggedIn', updateSession);
62
+ this.sdk.subscribeToEvent('sessionLoaded', updateSession);
63
+ this.sdk.subscribeToEvent('tokenRefreshed', updateSession);
64
+ this.sdk.subscribeToEvent('tokenRefreshFailed', updateSession);
65
+ this.sdk.subscribeToEvent('logoutInitiated', updateSession);
66
+ this.sdk.subscribeToEvent('tokenRevoked', updateSession);
67
+ this.sdk.subscribeToEvent('tokenRevokeFailed', updateSession);
68
+ }
69
+ /**
70
+ * Checks if the user is authenticated.
71
+ *
72
+ * @returns {Observable<boolean>} An observable that emits the authentication status.
73
+ */
74
+ isAuthenticated() {
75
+ return from(this.sdk.isAuthenticated);
76
+ }
77
+ /**
78
+ * Logs the user in using the specified options.
79
+ *
80
+ * @param {Parameters<Flow['login']>[0]} [options] Options to customize the login behavior.
81
+ * @returns {Observable<void>} An observable that completes when the login process is done.
82
+ */
83
+ login(options) {
84
+ return from(this.sdk.login(options));
85
+ }
86
+ /**
87
+ * Registers a new user using the specified options.
88
+ *
89
+ * @param {Parameters<Flow['register']>[0]} [options] Options to customize the registration behavior.
90
+ * @returns {Observable<void>} An observable that completes when the registration process is done.
91
+ */
92
+ register(options) {
93
+ return from(this.sdk.register(options));
94
+ }
95
+ /**
96
+ * Refreshes the current authentication session.
97
+ *
98
+ * @returns {Observable<void>} An observable that completes when the session is refreshed.
99
+ */
100
+ refresh() {
101
+ return from(this.sdk.refresh());
102
+ }
103
+ /**
104
+ * Revokes the current session tokens.
105
+ *
106
+ * @returns {Observable<void>} An observable that completes when the tokens are revoked.
107
+ */
108
+ revoke() {
109
+ return from(this.sdk.revoke());
110
+ }
111
+ /**
112
+ * Logs the user out using the specified options.
113
+ *
114
+ * @param {Parameters<Flow['logout']>[0]} [options] Options to customize the logout behavior.
115
+ * @returns {Observable<void>} An observable that completes when the logout process is done.
116
+ */
117
+ logout(options) {
118
+ return from(this.sdk.logout(options));
119
+ }
120
+ /**
121
+ * Handles the authentication callback (e.g., after a redirect or popup flow).
122
+ *
123
+ * @param {Parameters<Flow['handleCallback']>[0]} [url] The URL to handle for the callback.
124
+ * @returns {Observable<void>} An observable that completes when the callback is handled.
125
+ */
126
+ handleCallback(url) {
127
+ return from(this.sdk.handleCallback(url));
128
+ }
129
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthService, deps: [{ token: STRIVACITY_SDK }], target: i0.ɵɵFactoryTarget.Injectable });
130
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthService, providedIn: 'root' });
131
+ }
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthService, decorators: [{
133
+ type: Injectable,
134
+ args: [{
135
+ providedIn: 'root',
136
+ }]
137
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
138
+ type: Inject,
139
+ args: [STRIVACITY_SDK]
140
+ }] }] });
141
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6Ii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FuIG9ic2VydmFibGUgdGhhdCBjb21wbGV0ZXMgd2hlbiB0aGUgbG9nb3V0IHByb2Nlc3MgaXMgZG9uZS5cblx0ICovXG5cdGxvZ291dChvcHRpb25zPzogUGFyYW1ldGVyczxGbG93Wydsb2dvdXQnXT5bMF0pIHtcblx0XHRyZXR1cm4gZnJvbSh0aGlzLnNkay5sb2dvdXQob3B0aW9ucykpO1xuXHR9XG5cblx0LyoqXG5cdCAqIEhhbmRsZXMgdGhlIGF1dGhlbnRpY2F0aW9uIGNhbGxiYWNrIChlLmcuLCBhZnRlciBhIHJlZGlyZWN0IG9yIHBvcHVwIGZsb3cpLlxuXHQgKlxuXHQgKiBAcGFyYW0ge1BhcmFtZXRlcnM8Rmxvd1snaGFuZGxlQ2FsbGJhY2snXT5bMF19IFt1cmxdIFRoZSBVUkwgdG8gaGFuZGxlIGZvciB0aGUgY2FsbGJhY2suXG5cdCAqIEByZXR1cm5zIHtPYnNlcnZhYmxlPHZvaWQ+fSBBbiBvYnNlcnZhYmxlIHRoYXQgY29tcGxldGVzIHdoZW4gdGhlIGNhbGxiYWNrIGlzIGhhbmRsZWQuXG5cdCAqL1xuXHRoYW5kbGVDYWxsYmFjayh1cmw/OiBQYXJhbWV0ZXJzPEZsb3dbJ2hhbmRsZUNhbGxiYWNrJ10+WzBdKSB7XG5cdFx0cmV0dXJuIGZyb20odGhpcy5zZGsuaGFuZGxlQ2FsbGJhY2sodXJsKSk7XG5cdH1cbn1cbiJdfQ==
@@ -0,0 +1,23 @@
1
+ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
2
+ import { StrivacityAuthService } from './services/auth.service';
3
+ import { provideStrivacity } from './utils/helpers';
4
+ import * as i0 from "@angular/core";
5
+ export class StrivacityAuthModule {
6
+ static forRoot(options) {
7
+ return {
8
+ ngModule: StrivacityAuthModule,
9
+ providers: [provideStrivacity(options)],
10
+ };
11
+ }
12
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule });
14
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule, providers: [StrivacityAuthService] });
15
+ }
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule, decorators: [{
17
+ type: NgModule,
18
+ args: [{
19
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
20
+ providers: [StrivacityAuthService],
21
+ }]
22
+ }] });
23
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaXZhY2l0eS1hdXRoLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvc3RyaXZhY2l0eS1hdXRoLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQTRCLHNCQUFzQixFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUzRixPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQzs7QUFNcEQsTUFBTSxPQUFPLG9CQUFvQjtJQUNoQyxNQUFNLENBQUMsT0FBTyxDQUFDLE9BQW1CO1FBQ2pDLE9BQU87WUFDTixRQUFRLEVBQUUsb0JBQW9CO1lBQzlCLFNBQVMsRUFBRSxDQUFDLGlCQUFpQixDQUFDLE9BQU8sQ0FBQyxDQUFDO1NBQ3ZDLENBQUM7SUFDSCxDQUFDO3VHQU5XLG9CQUFvQjt3R0FBcEIsb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 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const STRIVACITY_SDK = new InjectionToken('sty');
3
+ /**
4
+ * Provides the Strivacity SDK configuration as a dependency injection token.
5
+ *
6
+ * This function is used to supply the Strivacity SDK configuration to the application
7
+ * by binding it to the `STRIVACITY_SDK` token.
8
+ *
9
+ * @param {SDKOptions} config The SDK configuration options.
10
+ * @returns {{ provide: InjectionToken<SDKOptions>, useValue: SDKOptions }} An object that provides the SDK configuration using the `STRIVACITY_SDK` token.
11
+ */
12
+ export function provideStrivacity(config) {
13
+ return { provide: STRIVACITY_SDK, useValue: config };
14
+ }
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdXRpbHMvaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRy9DLE1BQU0sQ0FBQyxNQUFNLGNBQWMsR0FBRyxJQUFJLGNBQWMsQ0FBYSxLQUFLLENBQUMsQ0FBQztBQUVwRTs7Ozs7Ozs7R0FRRztBQUNILE1BQU0sVUFBVSxpQkFBaUIsQ0FBQyxNQUFrQjtJQUNuRCxPQUFPLEVBQUUsT0FBTyxFQUFFLGNBQWMsRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLENBQUM7QUFDdEQsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGlvblRva2VuIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgdHlwZSB7IFNES09wdGlvbnMgfSBmcm9tICdAc3RyaXZhY2l0eS9zZGstY29yZSc7XG5cbmV4cG9ydCBjb25zdCBTVFJJVkFDSVRZX1NESyA9IG5ldyBJbmplY3Rpb25Ub2tlbjxTREtPcHR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ZTogbnVtYmVyIHwgbnVsbDtcbn07XG4iXX0=
@@ -0,0 +1,6 @@
1
+ export { LocalStorage } from '@strivacity/sdk-core/storages/LocalStorage';
2
+ export { SessionStorage } from '@strivacity/sdk-core/storages/SessionStorage';
3
+ export { StrivacityAuthService } from './lib/services/auth.service';
4
+ export { STRIVACITY_SDK, provideStrivacity } from './lib/utils/helpers';
5
+ export { StrivacityAuthModule } from './lib/strivacity-auth.module';
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUtBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw0Q0FBNEMsQ0FBQztBQUMxRSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sOENBQThDLENBQUM7QUFDOUUsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDcEUsT0FBTyxFQUFFLGNBQWMsRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3hFLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDhCQUE4QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgeyBTREtPcHRpb25zLCBTREtTdG9yYWdlLCBJZFRva2VuQ2xhaW1zIH0gZnJvbSAnQHN0cml2YWNpdHkvc2RrLWNvcmUnO1xuZXhwb3J0IHR5cGUgeyBQb3B1cEZsb3cgfSBmcm9tICdAc3RyaXZhY2l0eS9zZGstY29yZS9mbG93cy9Qb3B1cEZsb3cnO1xuZXhwb3J0IHR5cGUgeyBSZWRpcmVjdEZsb3cgfSBmcm9tICdAc3RyaXZhY2l0eS9zZGstY29yZS9mbG93cy9SZWRpcmVjdEZsb3cnO1xuZXhwb3J0IHR5cGUgeyBTZXNzaW9uIH0gZnJvbSAnLi9saWIvdXRpbHMvdHlwZXMnO1xuXG5leHBvcnQgeyBMb2NhbFN0b3JhZ2UgfSBmcm9tICdAc3RyaXZhY2l0eS9zZGstY29yZS9zdG9yYWdlcy9Mb2NhbFN0b3JhZ2UnO1xuZXhwb3J0IHsgU2Vzc2lvblN0b3JhZ2UgfSBmcm9tICdAc3RyaXZhY2l0eS9zZGstY29yZS9zdG9yYWdlcy9TZXNzaW9uU3RvcmFnZSc7XG5leHBvcnQgeyBTdHJpdmFjaXR5QXV0aFNlcnZpY2UgfSBmcm9tICcuL2xpYi9zZXJ2aWNlcy9hdXRoLnNlcnZpY2UnO1xuZXhwb3J0IHsgU1RSSVZBQ0lUWV9TREssIHByb3ZpZGVTdHJpdmFjaXR5IH0gZnJvbSAnLi9saWIvdXRpbHMvaGVscGVycyc7XG5leHBvcnQgeyBTdHJpdmFjaXR5QXV0aE1vZHVsZSB9IGZyb20gJy4vbGliL3N0cml2YWNpdHktYXV0aC5tb2R1bGUnO1xuIl19
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaXZhY2l0eS1zZGstYW5ndWxhci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpdmFjaXR5LXNkay1hbmd1bGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=
@@ -0,0 +1,182 @@
1
+ export { LocalStorage } from '@strivacity/sdk-core/storages/LocalStorage';
2
+ export { SessionStorage } from '@strivacity/sdk-core/storages/SessionStorage';
3
+ import * as i0 from '@angular/core';
4
+ import { InjectionToken, Injectable, Inject, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
5
+ import { BehaviorSubject, from } from 'rxjs';
6
+ import { initFlow } from '@strivacity/sdk-core';
7
+
8
+ const STRIVACITY_SDK = new InjectionToken('sty');
9
+ /**
10
+ * Provides the Strivacity SDK configuration as a dependency injection token.
11
+ *
12
+ * This function is used to supply the Strivacity SDK configuration to the application
13
+ * by binding it to the `STRIVACITY_SDK` token.
14
+ *
15
+ * @param {SDKOptions} config The SDK configuration options.
16
+ * @returns {{ provide: InjectionToken<SDKOptions>, useValue: SDKOptions }} An object that provides the SDK configuration using the `STRIVACITY_SDK` token.
17
+ */
18
+ function provideStrivacity(config) {
19
+ return { provide: STRIVACITY_SDK, useValue: config };
20
+ }
21
+
22
+ /**
23
+ * Service that manages Strivacity authentication flows.
24
+ * Supports either PopupFlow or RedirectFlow types.
25
+ *
26
+ * @template Flow Type of authentication flow (PopupFlow or RedirectFlow).
27
+ * @template Options Type of SDK options (defaults to SDKOptions).
28
+ */
29
+ class StrivacityAuthService {
30
+ options;
31
+ /**
32
+ * Instance of the authentication flow (PopupFlow or RedirectFlow).
33
+ * @protected
34
+ */
35
+ sdk;
36
+ /**
37
+ * BehaviorSubject that holds the current session state.
38
+ * @protected
39
+ * @readonly
40
+ */
41
+ sessionSubject;
42
+ /**
43
+ * Observable that emits the session state changes.
44
+ * @readonly
45
+ */
46
+ session$;
47
+ /**
48
+ * Creates an instance of StrivacityAuthService.
49
+ *
50
+ * @param {Options} options SDK configuration options injected via STRIVACITY_SDK.
51
+ */
52
+ constructor(options) {
53
+ this.options = options;
54
+ this.sdk = initFlow(options);
55
+ this.sessionSubject = new BehaviorSubject({
56
+ loading: true,
57
+ isAuthenticated: false,
58
+ idTokenClaims: null,
59
+ accessToken: null,
60
+ refreshToken: null,
61
+ accessTokenExpired: true,
62
+ accessTokenExpirationDate: null,
63
+ });
64
+ this.session$ = this.sessionSubject.asObservable();
65
+ const updateSession = async () => {
66
+ this.sessionSubject.next({
67
+ loading: false,
68
+ isAuthenticated: await this.sdk.isAuthenticated,
69
+ idTokenClaims: this.sdk.idTokenClaims || null,
70
+ accessToken: this.sdk.accessToken || null,
71
+ refreshToken: this.sdk.refreshToken || null,
72
+ accessTokenExpired: this.sdk.accessTokenExpired,
73
+ accessTokenExpirationDate: this.sdk.accessTokenExpirationDate || null,
74
+ });
75
+ };
76
+ this.sdk.subscribeToEvent('init', updateSession);
77
+ this.sdk.subscribeToEvent('loggedIn', updateSession);
78
+ this.sdk.subscribeToEvent('sessionLoaded', updateSession);
79
+ this.sdk.subscribeToEvent('tokenRefreshed', updateSession);
80
+ this.sdk.subscribeToEvent('tokenRefreshFailed', updateSession);
81
+ this.sdk.subscribeToEvent('logoutInitiated', updateSession);
82
+ this.sdk.subscribeToEvent('tokenRevoked', updateSession);
83
+ this.sdk.subscribeToEvent('tokenRevokeFailed', updateSession);
84
+ }
85
+ /**
86
+ * Checks if the user is authenticated.
87
+ *
88
+ * @returns {Observable<boolean>} An observable that emits the authentication status.
89
+ */
90
+ isAuthenticated() {
91
+ return from(this.sdk.isAuthenticated);
92
+ }
93
+ /**
94
+ * Logs the user in using the specified options.
95
+ *
96
+ * @param {Parameters<Flow['login']>[0]} [options] Options to customize the login behavior.
97
+ * @returns {Observable<void>} An observable that completes when the login process is done.
98
+ */
99
+ login(options) {
100
+ return from(this.sdk.login(options));
101
+ }
102
+ /**
103
+ * Registers a new user using the specified options.
104
+ *
105
+ * @param {Parameters<Flow['register']>[0]} [options] Options to customize the registration behavior.
106
+ * @returns {Observable<void>} An observable that completes when the registration process is done.
107
+ */
108
+ register(options) {
109
+ return from(this.sdk.register(options));
110
+ }
111
+ /**
112
+ * Refreshes the current authentication session.
113
+ *
114
+ * @returns {Observable<void>} An observable that completes when the session is refreshed.
115
+ */
116
+ refresh() {
117
+ return from(this.sdk.refresh());
118
+ }
119
+ /**
120
+ * Revokes the current session tokens.
121
+ *
122
+ * @returns {Observable<void>} An observable that completes when the tokens are revoked.
123
+ */
124
+ revoke() {
125
+ return from(this.sdk.revoke());
126
+ }
127
+ /**
128
+ * Logs the user out using the specified options.
129
+ *
130
+ * @param {Parameters<Flow['logout']>[0]} [options] Options to customize the logout behavior.
131
+ * @returns {Observable<void>} An observable that completes when the logout process is done.
132
+ */
133
+ logout(options) {
134
+ return from(this.sdk.logout(options));
135
+ }
136
+ /**
137
+ * Handles the authentication callback (e.g., after a redirect or popup flow).
138
+ *
139
+ * @param {Parameters<Flow['handleCallback']>[0]} [url] The URL to handle for the callback.
140
+ * @returns {Observable<void>} An observable that completes when the callback is handled.
141
+ */
142
+ handleCallback(url) {
143
+ return from(this.sdk.handleCallback(url));
144
+ }
145
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthService, deps: [{ token: STRIVACITY_SDK }], target: i0.ɵɵFactoryTarget.Injectable });
146
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthService, providedIn: 'root' });
147
+ }
148
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthService, decorators: [{
149
+ type: Injectable,
150
+ args: [{
151
+ providedIn: 'root',
152
+ }]
153
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
154
+ type: Inject,
155
+ args: [STRIVACITY_SDK]
156
+ }] }] });
157
+
158
+ class StrivacityAuthModule {
159
+ static forRoot(options) {
160
+ return {
161
+ ngModule: StrivacityAuthModule,
162
+ providers: [provideStrivacity(options)],
163
+ };
164
+ }
165
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
166
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule });
167
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule, providers: [StrivacityAuthService] });
168
+ }
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.4", ngImport: i0, type: StrivacityAuthModule, decorators: [{
170
+ type: NgModule,
171
+ args: [{
172
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
173
+ providers: [StrivacityAuthService],
174
+ }]
175
+ }] });
176
+
177
+ /**
178
+ * Generated bundle index. Do not edit.
179
+ */
180
+
181
+ export { STRIVACITY_SDK, StrivacityAuthModule, StrivacityAuthService, provideStrivacity };
182
+ //# sourceMappingURL=strivacity-sdk-angular.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strivacity-sdk-angular.mjs","sources":["../../src/lib/utils/helpers.ts","../../src/lib/services/auth.service.ts","../../src/lib/strivacity-auth.module.ts","../../src/strivacity-sdk-angular.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { SDKOptions } from '@strivacity/sdk-core';\n\nexport const STRIVACITY_SDK = new InjectionToken<SDKOptions>('sty');\n\n/**\n * Provides the Strivacity SDK configuration as a dependency injection token.\n *\n * This function is used to supply the Strivacity SDK configuration to the application\n * by binding it to the `STRIVACITY_SDK` token.\n *\n * @param {SDKOptions} config The SDK configuration options.\n * @returns {{ provide: InjectionToken<SDKOptions>, useValue: SDKOptions }} An object that provides the SDK configuration using the `STRIVACITY_SDK` token.\n */\nexport function provideStrivacity(config: SDKOptions) {\n\treturn { provide: STRIVACITY_SDK, useValue: config };\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { type Observable, BehaviorSubject, from } from 'rxjs';\nimport type { PopupFlow } from '@strivacity/sdk-core/flows/PopupFlow';\nimport type { RedirectFlow } from '@strivacity/sdk-core/flows/RedirectFlow';\nimport { type SDKOptions, initFlow } from '@strivacity/sdk-core';\nimport type { Session } from '../utils/types';\nimport { STRIVACITY_SDK } from '../utils/helpers';\n\n/**\n * Service that manages Strivacity authentication flows.\n * Supports either PopupFlow or RedirectFlow types.\n *\n * @template Flow Type of authentication flow (PopupFlow or RedirectFlow).\n * @template Options Type of SDK options (defaults to SDKOptions).\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class StrivacityAuthService<Flow extends PopupFlow | RedirectFlow = PopupFlow | RedirectFlow, Options extends SDKOptions = SDKOptions> {\n\t/**\n\t * Instance of the authentication flow (PopupFlow or RedirectFlow).\n\t * @protected\n\t */\n\tprotected sdk: Flow;\n\t/**\n\t * BehaviorSubject that holds the current session state.\n\t * @protected\n\t * @readonly\n\t */\n\tprivate readonly sessionSubject: BehaviorSubject<Session>;\n\t/**\n\t * Observable that emits the session state changes.\n\t * @readonly\n\t */\n\treadonly session$: Observable<Session>;\n\n\t/**\n\t * Creates an instance of StrivacityAuthService.\n\t *\n\t * @param {Options} options SDK configuration options injected via STRIVACITY_SDK.\n\t */\n\tconstructor(@Inject(STRIVACITY_SDK) public options: Options) {\n\t\tthis.sdk = initFlow(options) as Flow;\n\t\tthis.sessionSubject = new BehaviorSubject<Session>({\n\t\t\tloading: true,\n\t\t\tisAuthenticated: false,\n\t\t\tidTokenClaims: null,\n\t\t\taccessToken: null,\n\t\t\trefreshToken: null,\n\t\t\taccessTokenExpired: true,\n\t\t\taccessTokenExpirationDate: null,\n\t\t});\n\t\tthis.session$ = this.sessionSubject.asObservable();\n\n\t\tconst updateSession = async () => {\n\t\t\tthis.sessionSubject.next({\n\t\t\t\tloading: false,\n\t\t\t\tisAuthenticated: await this.sdk.isAuthenticated,\n\t\t\t\tidTokenClaims: this.sdk.idTokenClaims || null,\n\t\t\t\taccessToken: this.sdk.accessToken || null,\n\t\t\t\trefreshToken: this.sdk.refreshToken || null,\n\t\t\t\taccessTokenExpired: this.sdk.accessTokenExpired,\n\t\t\t\taccessTokenExpirationDate: this.sdk.accessTokenExpirationDate || null,\n\t\t\t});\n\t\t};\n\n\t\tthis.sdk.subscribeToEvent('init', updateSession);\n\t\tthis.sdk.subscribeToEvent('loggedIn', updateSession);\n\t\tthis.sdk.subscribeToEvent('sessionLoaded', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRefreshed', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRefreshFailed', updateSession);\n\t\tthis.sdk.subscribeToEvent('logoutInitiated', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRevoked', updateSession);\n\t\tthis.sdk.subscribeToEvent('tokenRevokeFailed', updateSession);\n\t}\n\n\t/**\n\t * Checks if the user is authenticated.\n\t *\n\t * @returns {Observable<boolean>} An observable that emits the authentication status.\n\t */\n\tisAuthenticated() {\n\t\treturn from(this.sdk.isAuthenticated);\n\t}\n\n\t/**\n\t * Logs the user in using the specified options.\n\t *\n\t * @param {Parameters<Flow['login']>[0]} [options] Options to customize the login behavior.\n\t * @returns {Observable<void>} An observable that completes when the login process is done.\n\t */\n\tlogin(options?: Parameters<Flow['login']>[0]) {\n\t\treturn from(this.sdk.login(options));\n\t}\n\n\t/**\n\t * Registers a new user using the specified options.\n\t *\n\t * @param {Parameters<Flow['register']>[0]} [options] Options to customize the registration behavior.\n\t * @returns {Observable<void>} An observable that completes when the registration process is done.\n\t */\n\tregister(options?: Parameters<Flow['register']>[0]) {\n\t\treturn from(this.sdk.register(options));\n\t}\n\n\t/**\n\t * Refreshes the current authentication session.\n\t *\n\t * @returns {Observable<void>} An observable that completes when the session is refreshed.\n\t */\n\trefresh() {\n\t\treturn from(this.sdk.refresh());\n\t}\n\n\t/**\n\t * Revokes the current session tokens.\n\t *\n\t * @returns {Observable<void>} An observable that completes when the tokens are revoked.\n\t */\n\trevoke() {\n\t\treturn from(this.sdk.revoke());\n\t}\n\n\t/**\n\t * Logs the user out using the specified options.\n\t *\n\t * @param {Parameters<Flow['logout']>[0]} [options] Options to customize the logout behavior.\n\t * @returns {Observable<void>} An observable that completes when the logout process is done.\n\t */\n\tlogout(options?: Parameters<Flow['logout']>[0]) {\n\t\treturn from(this.sdk.logout(options));\n\t}\n\n\t/**\n\t * Handles the authentication callback (e.g., after a redirect or popup flow).\n\t *\n\t * @param {Parameters<Flow['handleCallback']>[0]} [url] The URL to handle for the callback.\n\t * @returns {Observable<void>} An observable that completes when the callback is handled.\n\t */\n\thandleCallback(url?: Parameters<Flow['handleCallback']>[0]) {\n\t\treturn from(this.sdk.handleCallback(url));\n\t}\n}\n","import { type ModuleWithProviders, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';\nimport type { SDKOptions } from '@strivacity/sdk-core';\nimport { StrivacityAuthService } from './services/auth.service';\nimport { provideStrivacity } from './utils/helpers';\n\n@NgModule({\n\tschemas: [CUSTOM_ELEMENTS_SCHEMA],\n\tproviders: [StrivacityAuthService],\n})\nexport class StrivacityAuthModule {\n\tstatic forRoot(options: SDKOptions): ModuleWithProviders<StrivacityAuthModule> {\n\t\treturn {\n\t\t\tngModule: StrivacityAuthModule,\n\t\t\tproviders: [provideStrivacity(options)],\n\t\t};\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAGa,cAAc,GAAG,IAAI,cAAc,CAAa,KAAK,EAAE;AAEpE;;;;;;;;AAQG;AACG,SAAU,iBAAiB,CAAC,MAAkB,EAAA;IACnD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACtD;;ACRA;;;;;;AAMG;MAIU,qBAAqB,CAAA;AAuBU,IAAA,OAAA,CAAA;AAtB3C;;;AAGG;AACO,IAAA,GAAG,CAAO;AACpB;;;;AAIG;AACc,IAAA,cAAc,CAA2B;AAC1D;;;AAGG;AACM,IAAA,QAAQ,CAAsB;AAEvC;;;;AAIG;AACH,IAAA,WAAA,CAA2C,OAAgB,EAAA;QAAhB,IAAO,CAAA,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C;AAClC,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@strivacity/sdk-angular" />
5
+ export * from './public-api';
@@ -0,0 +1,86 @@
1
+ import { type Observable } from 'rxjs';
2
+ import type { PopupFlow } from '@strivacity/sdk-core/flows/PopupFlow';
3
+ import type { RedirectFlow } from '@strivacity/sdk-core/flows/RedirectFlow';
4
+ import { type SDKOptions } from '@strivacity/sdk-core';
5
+ import type { Session } from '../utils/types';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Service that manages Strivacity authentication flows.
9
+ * Supports either PopupFlow or RedirectFlow types.
10
+ *
11
+ * @template Flow Type of authentication flow (PopupFlow or RedirectFlow).
12
+ * @template Options Type of SDK options (defaults to SDKOptions).
13
+ */
14
+ export declare class StrivacityAuthService<Flow extends PopupFlow | RedirectFlow = PopupFlow | RedirectFlow, Options extends SDKOptions = SDKOptions> {
15
+ options: Options;
16
+ /**
17
+ * Instance of the authentication flow (PopupFlow or RedirectFlow).
18
+ * @protected
19
+ */
20
+ protected sdk: Flow;
21
+ /**
22
+ * BehaviorSubject that holds the current session state.
23
+ * @protected
24
+ * @readonly
25
+ */
26
+ private readonly sessionSubject;
27
+ /**
28
+ * Observable that emits the session state changes.
29
+ * @readonly
30
+ */
31
+ readonly session$: Observable<Session>;
32
+ /**
33
+ * Creates an instance of StrivacityAuthService.
34
+ *
35
+ * @param {Options} options SDK configuration options injected via STRIVACITY_SDK.
36
+ */
37
+ constructor(options: Options);
38
+ /**
39
+ * Checks if the user is authenticated.
40
+ *
41
+ * @returns {Observable<boolean>} An observable that emits the authentication status.
42
+ */
43
+ isAuthenticated(): Observable<boolean>;
44
+ /**
45
+ * Logs the user in using the specified options.
46
+ *
47
+ * @param {Parameters<Flow['login']>[0]} [options] Options to customize the login behavior.
48
+ * @returns {Observable<void>} An observable that completes when the login process is done.
49
+ */
50
+ login(options?: Parameters<Flow['login']>[0]): Observable<void>;
51
+ /**
52
+ * Registers a new user using the specified options.
53
+ *
54
+ * @param {Parameters<Flow['register']>[0]} [options] Options to customize the registration behavior.
55
+ * @returns {Observable<void>} An observable that completes when the registration process is done.
56
+ */
57
+ register(options?: Parameters<Flow['register']>[0]): Observable<void>;
58
+ /**
59
+ * Refreshes the current authentication session.
60
+ *
61
+ * @returns {Observable<void>} An observable that completes when the session is refreshed.
62
+ */
63
+ refresh(): Observable<void>;
64
+ /**
65
+ * Revokes the current session tokens.
66
+ *
67
+ * @returns {Observable<void>} An observable that completes when the tokens are revoked.
68
+ */
69
+ revoke(): Observable<void>;
70
+ /**
71
+ * Logs the user out using the specified options.
72
+ *
73
+ * @param {Parameters<Flow['logout']>[0]} [options] Options to customize the logout behavior.
74
+ * @returns {Observable<void>} An observable that completes when the logout process is done.
75
+ */
76
+ logout(options?: Parameters<Flow['logout']>[0]): Observable<void>;
77
+ /**
78
+ * Handles the authentication callback (e.g., after a redirect or popup flow).
79
+ *
80
+ * @param {Parameters<Flow['handleCallback']>[0]} [url] The URL to handle for the callback.
81
+ * @returns {Observable<void>} An observable that completes when the callback is handled.
82
+ */
83
+ handleCallback(url?: Parameters<Flow['handleCallback']>[0]): Observable<void>;
84
+ static ɵfac: i0.ɵɵFactoryDeclaration<StrivacityAuthService<any, any>, never>;
85
+ static ɵprov: i0.ɵɵInjectableDeclaration<StrivacityAuthService<any, any>>;
86
+ }
@@ -0,0 +1,9 @@
1
+ import { type ModuleWithProviders } from '@angular/core';
2
+ import type { SDKOptions } from '@strivacity/sdk-core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class StrivacityAuthModule {
5
+ static forRoot(options: SDKOptions): ModuleWithProviders<StrivacityAuthModule>;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<StrivacityAuthModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<StrivacityAuthModule, never, never, never>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<StrivacityAuthModule>;
9
+ }
@@ -0,0 +1,16 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import type { SDKOptions } from '@strivacity/sdk-core';
3
+ export declare const STRIVACITY_SDK: InjectionToken<SDKOptions>;
4
+ /**
5
+ * Provides the Strivacity SDK configuration as a dependency injection token.
6
+ *
7
+ * This function is used to supply the Strivacity SDK configuration to the application
8
+ * by binding it to the `STRIVACITY_SDK` token.
9
+ *
10
+ * @param {SDKOptions} config The SDK configuration options.
11
+ * @returns {{ provide: InjectionToken<SDKOptions>, useValue: SDKOptions }} An object that provides the SDK configuration using the `STRIVACITY_SDK` token.
12
+ */
13
+ export declare function provideStrivacity(config: SDKOptions): {
14
+ provide: InjectionToken<SDKOptions>;
15
+ useValue: SDKOptions;
16
+ };
@@ -0,0 +1,42 @@
1
+ import type { IdTokenClaims } from '@strivacity/sdk-core';
2
+ /**
3
+ * Represents the current authentication session state.
4
+ */
5
+ export type Session = {
6
+ /**
7
+ * Indicates whether the session is in the process of initializing.
8
+ * When `true`, the session information might not be fully available yet.
9
+ */
10
+ loading: boolean;
11
+ /**
12
+ * Indicates whether the user is currently authenticated.
13
+ * `true` if the user is authenticated, otherwise `false`.
14
+ */
15
+ isAuthenticated: boolean;
16
+ /**
17
+ * The claims contained in the ID token if the user is authenticated.
18
+ * This includes information such as the user's identity and authentication context.
19
+ * If the user is not authenticated, this will be `null`.
20
+ */
21
+ idTokenClaims: IdTokenClaims | null;
22
+ /**
23
+ * The current access token used for authorizing API requests.
24
+ * This token is `null` if the user is not authenticated or if the token has not been set.
25
+ */
26
+ accessToken: string | null;
27
+ /**
28
+ * The current refresh token used to obtain a new access token when the current one expires.
29
+ * This token is `null` if the user is not authenticated or if the token has not been set.
30
+ */
31
+ refreshToken: string | null;
32
+ /**
33
+ * Indicates whether the current access token has expired.
34
+ * `true` if the token is expired, otherwise `false`.
35
+ */
36
+ accessTokenExpired: boolean;
37
+ /**
38
+ * The expiration date of the current access token in Unix time (milliseconds since epoch).
39
+ * If the access token is not available or the session is not authenticated, this will be `null`.
40
+ */
41
+ accessTokenExpirationDate: number | null;
42
+ };
@@ -0,0 +1,9 @@
1
+ export type { SDKOptions, SDKStorage, IdTokenClaims } from '@strivacity/sdk-core';
2
+ export type { PopupFlow } from '@strivacity/sdk-core/flows/PopupFlow';
3
+ export type { RedirectFlow } from '@strivacity/sdk-core/flows/RedirectFlow';
4
+ export type { Session } from './lib/utils/types';
5
+ export { LocalStorage } from '@strivacity/sdk-core/storages/LocalStorage';
6
+ export { SessionStorage } from '@strivacity/sdk-core/storages/SessionStorage';
7
+ export { StrivacityAuthService } from './lib/services/auth.service';
8
+ export { STRIVACITY_SDK, provideStrivacity } from './lib/utils/helpers';
9
+ export { StrivacityAuthModule } from './lib/strivacity-auth.module';
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "dist",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ },
7
+ "allowedNonPeerDependencies": ["@strivacity/sdk-core"]
8
+ }
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@strivacity/sdk-angular",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "author": "strivacity <info@strivacity.com>",
7
+ "description": "Strivacity Angular SDK client",
8
+ "dependencies": {
9
+ "@strivacity/sdk-core": "1.0.0"
10
+ },
11
+ "peerDependencies": {
12
+ "@angular/core": ">=14"
13
+ },
14
+ "main": "./dist/esm2022/strivacity-sdk-angular.mjs",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/esm2022/strivacity-sdk-angular.mjs",
20
+ "esm": "./dist/esm2022/strivacity-sdk-angular.mjs",
21
+ "esm2022": "./dist/esm2022/strivacity-sdk-angular.mjs",
22
+ "default": "./dist/fesm2022/strivacity-sdk-angular.mjs"
23
+ }
24
+ }
25
+ }