@atlasauth/angular 0.4.0 → 0.5.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 +21 -0
- package/dist/esm2022/lib/atlas.service.mjs +30 -3
- package/dist/esm2022/lib/components/attempt-flow.component.mjs +33 -9
- package/dist/esm2022/lib/components/flow-controller.mjs +18 -2
- package/dist/esm2022/lib/components/sign-up-form.component.mjs +20 -13
- package/dist/esm2022/lib/i18n.mjs +43 -1
- package/dist/fesm2022/atlasauth-angular.mjs +136 -21
- package/dist/fesm2022/atlasauth-angular.mjs.map +1 -1
- package/dist/lib/atlas.service.d.ts +15 -1
- package/dist/lib/components/attempt-flow.component.d.ts +4 -0
- package/dist/lib/components/flow-controller.d.ts +7 -0
- package/dist/lib/components/sign-up-form.component.d.ts +3 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnDestroy, Signal } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { FapiClient, type ProviderToken, type SignOutOptions, type SignOutResult } from '@atlasauth/js';
|
|
3
|
+
import { FapiClient, type ErrorLike, type ProviderToken, type SignOutOptions, type SignOutResult } 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';
|
|
@@ -43,6 +43,10 @@ export declare class AtlasService implements OnDestroy {
|
|
|
43
43
|
private readonly guard;
|
|
44
44
|
private stopWatchingSignOut;
|
|
45
45
|
private readonly catalog;
|
|
46
|
+
/** The language layer of `catalog` (the `localization` bundle alone; `EN_US` when none). */
|
|
47
|
+
private readonly errorCatalog;
|
|
48
|
+
/** Sent to the Frontend API as `Accept-Language`: the `localization` bundle's `locale` tag. */
|
|
49
|
+
private readonly requestLocale;
|
|
46
50
|
/**
|
|
47
51
|
* A sign-in attempt handed back by an OAuth redirect that still needs a second
|
|
48
52
|
* factor (no session was issued). Null in the ordinary case; the `<atlas-sign-in>`
|
|
@@ -86,6 +90,16 @@ export declare class AtlasService implements OnDestroy {
|
|
|
86
90
|
get appearance(): Appearance | undefined;
|
|
87
91
|
get localization(): Catalog;
|
|
88
92
|
get frontendApi(): string;
|
|
93
|
+
/** The `Accept-Language` sent to the Frontend API: the `localization` bundle's `locale` tag, if any. */
|
|
94
|
+
get locale(): string | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* The text to show for a server error, in the app's language: the catalog's
|
|
97
|
+
* `error.<reason>` (looked up in the `localization` bundle, or `EN_US` when
|
|
98
|
+
* none is set), else the server's message, else `error.generic`.
|
|
99
|
+
*/
|
|
100
|
+
errorText(error: ErrorLike | string | null | undefined): string;
|
|
101
|
+
/** The catalog server errors are looked up in (see {@link errorText}). */
|
|
102
|
+
get errorLocalization(): Catalog;
|
|
89
103
|
/** Tokens as CSS custom properties, for a host element to inherit. */
|
|
90
104
|
appearanceVariables(): Record<string, string>;
|
|
91
105
|
/**
|
|
@@ -50,6 +50,8 @@ export declare class AttemptFlowComponent {
|
|
|
50
50
|
chooseFactor: EventEmitter<"email_code">;
|
|
51
51
|
protected values: Record<string, string>;
|
|
52
52
|
protected t(key: string, vars?: Record<string, string>): string;
|
|
53
|
+
/** A server error in the app's language (`error.<reason>`, else the server's message). */
|
|
54
|
+
protected errorText(error: FieldError): string;
|
|
53
55
|
protected cls(key: ElementKey, base: string): string;
|
|
54
56
|
protected setValue(name: string, value: string): void;
|
|
55
57
|
protected onSubmit(event: Event): void;
|
|
@@ -60,6 +62,8 @@ export declare class AttemptFlowComponent {
|
|
|
60
62
|
/** The first factors on offer at a `needs_first_factor` step (empty on any other). */
|
|
61
63
|
private offered;
|
|
62
64
|
protected showEmailCodeOption(): boolean;
|
|
65
|
+
/** The "we sent a code to …" line on the code step. */
|
|
66
|
+
protected codeSentText(): string | null;
|
|
63
67
|
protected showSubmit(): boolean;
|
|
64
68
|
protected fields(): StepField[];
|
|
65
69
|
static ɵfac: i0.ɵɵFactoryDeclaration<AttemptFlowComponent, never>;
|
|
@@ -73,6 +73,13 @@ export declare class AtlasFlowController {
|
|
|
73
73
|
/** Keep both captchas in step with the settings and the flow's current step. */
|
|
74
74
|
private syncCaptcha;
|
|
75
75
|
private setState;
|
|
76
|
+
private autoSentFor;
|
|
77
|
+
/**
|
|
78
|
+
* With no password on offer, email the code as soon as the server asks for a
|
|
79
|
+
* first factor — once per attempt, so a failed send waits for the user's retry
|
|
80
|
+
* (the "Email me a code" button) instead of looping.
|
|
81
|
+
*/
|
|
82
|
+
private autoSend;
|
|
76
83
|
/**
|
|
77
84
|
* Advance the flow with the values the user typed. On completion, exchange the
|
|
78
85
|
* one-time ticket for cookies over a same-origin request (FAPI is cross-origin
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import type
|
|
2
|
+
import { type CaptchaController, type FieldError, type InstanceSettings, type PublicSignUpField } from '@atlasauth/js';
|
|
3
3
|
import { type ElementKey } from '../appearance';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/** What the create-account form emits: the values typed plus the consent tick. */
|
|
@@ -26,6 +26,8 @@ export declare class SignUpFormComponent {
|
|
|
26
26
|
protected values: Record<string, string>;
|
|
27
27
|
protected agreed: boolean;
|
|
28
28
|
protected t(key: string, vars?: Record<string, string>): string;
|
|
29
|
+
/** A server error in the app's language (`error.<reason>`, else the server's message). */
|
|
30
|
+
protected errorText(error: FieldError): string;
|
|
29
31
|
protected cls(key: ElementKey, base: string): string;
|
|
30
32
|
protected setValue(name: string, value: string): void;
|
|
31
33
|
/** Email + password sign-up cannot complete: the app cannot send the verification email. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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,7 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"tslib": "^2.6.3",
|
|
22
22
|
"@atlasauth/design": "0.2.0",
|
|
23
|
-
"@atlasauth/js": "0.
|
|
23
|
+
"@atlasauth/js": "0.10.0",
|
|
24
24
|
"@atlasauth/authz": "0.1.1"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|