@atlasauth/angular 0.5.1 → 0.6.1
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 +19 -0
- package/dist/esm2022/lib/atlas.config.mjs +1 -1
- package/dist/esm2022/lib/atlas.service.mjs +50 -9
- package/dist/esm2022/lib/components/flow-controller.mjs +9 -4
- package/dist/esm2022/lib/components/user-profile.component.mjs +103 -2
- package/dist/esm2022/lib/i18n.mjs +12 -1
- package/dist/esm2022/lib/version.mjs +4 -0
- package/dist/esm2022/public-api.mjs +4 -1
- package/dist/fesm2022/atlasauth-angular.mjs +173 -12
- package/dist/fesm2022/atlasauth-angular.mjs.map +1 -1
- package/dist/lib/atlas.config.d.ts +8 -0
- package/dist/lib/atlas.service.d.ts +16 -2
- package/dist/lib/components/user-profile.component.d.ts +7 -0
- package/dist/lib/version.d.ts +4 -0
- package/dist/public-api.d.ts +3 -0
- package/package.json +3 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SignOutEvent } from '@atlasauth/js';
|
|
1
2
|
import { InjectionToken } from '@angular/core';
|
|
2
3
|
import type { Appearance } from './appearance';
|
|
3
4
|
import type { Catalog } from './i18n';
|
|
@@ -27,6 +28,13 @@ export interface AtlasOptions {
|
|
|
27
28
|
* or tests. Defaults to `globalThis.fetch`.
|
|
28
29
|
*/
|
|
29
30
|
fetchImpl?: typeof fetch;
|
|
31
|
+
/**
|
|
32
|
+
* Called once each time a signed-in user becomes signed out, on every path:
|
|
33
|
+
* `reason` is `user`, `other_tab`, `session_expired`, `revoked` (ended
|
|
34
|
+
* elsewhere, seen on the next refresh) or `unknown`. See also
|
|
35
|
+
* `AtlasService.signOut$`.
|
|
36
|
+
*/
|
|
37
|
+
onSignOut?: (event: SignOutEvent) => void;
|
|
30
38
|
}
|
|
31
39
|
/**
|
|
32
40
|
* DI token carrying the resolved {@link AtlasOptions}. Populated by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnDestroy, Signal } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { FapiClient, type ErrorLike, type ProviderToken, type SignOutOptions, type SignOutResult } from '@atlasauth/js';
|
|
3
|
+
import { FapiClient, type ErrorLike, type ProviderToken, type SignOutOptions, type SignOutResult, type SignOutEvent, type SignOutListener } from '@atlasauth/js';
|
|
4
4
|
import { type ProtectCondition } from '@atlasauth/authz';
|
|
5
5
|
import { type Appearance, type AppearanceRender, type InstanceDesign } from './appearance';
|
|
6
6
|
import { type Catalog } from './i18n';
|
|
@@ -62,6 +62,15 @@ export declare class AtlasService implements OnDestroy {
|
|
|
62
62
|
private readonly _session;
|
|
63
63
|
private readonly _claims;
|
|
64
64
|
private readonly _memberships;
|
|
65
|
+
private readonly notifier;
|
|
66
|
+
private readonly _signOut;
|
|
67
|
+
/**
|
|
68
|
+
* Emits once each time a signed-in user becomes signed out: `reason` is
|
|
69
|
+
* `user`, `other_tab`, `session_expired`, `revoked` (ended elsewhere, seen on
|
|
70
|
+
* the next token refresh) or `unknown`. The place to reset an embedded
|
|
71
|
+
* third party (a chat widget). Also dispatched as `atlas:signout` on `window`.
|
|
72
|
+
*/
|
|
73
|
+
readonly signOut$: Observable<SignOutEvent>;
|
|
65
74
|
/** The three-state auth lifecycle: `loading` → `signed_in` | `signed_out`. */
|
|
66
75
|
readonly status$: Observable<AuthStatus>;
|
|
67
76
|
readonly user$: Observable<AtlasUser | null>;
|
|
@@ -121,7 +130,10 @@ export declare class AtlasService implements OnDestroy {
|
|
|
121
130
|
* The current session's JWT, always fresh: if the cached token is within 5s of
|
|
122
131
|
* expiry it is refreshed first rather than handed over. Null when signed out.
|
|
123
132
|
*/
|
|
124
|
-
|
|
133
|
+
/** The session JWT; with `{ template }` a short-lived named-template token (e.g. `'chatly'`). */
|
|
134
|
+
getToken(options?: {
|
|
135
|
+
template?: string;
|
|
136
|
+
}): Promise<string | null>;
|
|
125
137
|
/**
|
|
126
138
|
* The signed-in user's OWN live access token at a connected provider (Google,
|
|
127
139
|
* GitHub, …), so the app can call that provider's API from the browser. Null
|
|
@@ -129,6 +141,8 @@ export declare class AtlasService implements OnDestroy {
|
|
|
129
141
|
* kept none. The server refreshes a stale token on read; the refresh token is
|
|
130
142
|
* never exposed.
|
|
131
143
|
*/
|
|
144
|
+
/** Listen for sign-out on every path (see {@link signOut$}); returns the unsubscribe. */
|
|
145
|
+
onSignOut(listener: SignOutListener): () => void;
|
|
132
146
|
getProviderToken(provider: string): Promise<ProviderToken | null>;
|
|
133
147
|
/** Imperative `has()` — the same evaluation `*atlasProtect` renders on. */
|
|
134
148
|
has(condition: ProtectCondition): boolean;
|
|
@@ -8,6 +8,13 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class UserProfileComponent {
|
|
10
10
|
protected readonly atlas: AtlasService;
|
|
11
|
+
protected readonly verifying: import("@angular/core").WritableSignal<string>;
|
|
12
|
+
protected readonly code: import("@angular/core").WritableSignal<string>;
|
|
13
|
+
protected readonly busy: import("@angular/core").WritableSignal<boolean>;
|
|
14
|
+
protected readonly verifyError: import("@angular/core").WritableSignal<string>;
|
|
15
|
+
private readonly client;
|
|
16
|
+
protected sendCode(id: string): Promise<void>;
|
|
17
|
+
protected confirmCode(): Promise<void>;
|
|
11
18
|
protected t(key: string): string;
|
|
12
19
|
protected cls(key: ElementKey, base: string): string;
|
|
13
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserProfileComponent, never>;
|
package/dist/public-api.d.ts
CHANGED
|
@@ -30,3 +30,6 @@ export * from './lib/types';
|
|
|
30
30
|
export * from './lib/fapi';
|
|
31
31
|
export type { InstanceSettings, PublicSignUpField, CaptchaController, CaptchaFlowKey, CaptchaWidgetMode, FlowCaptcha, EmailDelivery, SignOutOptions, SignOutResult, } from '@atlasauth/js';
|
|
32
32
|
export { SignOutError } from '@atlasauth/js';
|
|
33
|
+
export { SIGN_OUT_EVENT, onAtlasSignOut } from '@atlasauth/js';
|
|
34
|
+
export type { SignOutEvent, SignOutReason } from '@atlasauth/js';
|
|
35
|
+
export { ATLAS_ANGULAR_SDK, ATLAS_ANGULAR_VERSION } from './lib/version';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Official Angular SDK for Atlas — the Angular peer of @atlasauth/react.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "./dist/fesm2022/atlas-angular.mjs",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"tslib": "^2.6.3",
|
|
22
22
|
"@atlasauth/design": "0.2.0",
|
|
23
|
-
"@atlasauth/
|
|
24
|
-
"@atlasauth/
|
|
23
|
+
"@atlasauth/authz": "0.1.1",
|
|
24
|
+
"@atlasauth/js": "0.12.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@angular/core": ">=17",
|