@mintplayer/ng-spark 22.30.0 → 22.32.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/README.md +2 -2
- package/auth/README.md +216 -0
- package/fesm2022/mintplayer-ng-spark-auth-account.mjs +2023 -0
- package/fesm2022/mintplayer-ng-spark-auth-account.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-auth-bar.mjs +96 -0
- package/fesm2022/mintplayer-ng-spark-auth-auth-bar.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-confirm-email.mjs +200 -0
- package/fesm2022/mintplayer-ng-spark-auth-confirm-email.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-core.mjs +452 -0
- package/fesm2022/mintplayer-ng-spark-auth-core.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-external-login.mjs +201 -0
- package/fesm2022/mintplayer-ng-spark-auth-external-login.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-forgot-password.mjs +196 -0
- package/fesm2022/mintplayer-ng-spark-auth-forgot-password.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-guards.mjs +16 -0
- package/fesm2022/mintplayer-ng-spark-auth-guards.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-interceptors.mjs +18 -0
- package/fesm2022/mintplayer-ng-spark-auth-interceptors.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-login.mjs +282 -0
- package/fesm2022/mintplayer-ng-spark-auth-login.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-models.mjs +114 -0
- package/fesm2022/mintplayer-ng-spark-auth-models.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-pipes.mjs +43 -0
- package/fesm2022/mintplayer-ng-spark-auth-pipes.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-register.mjs +216 -0
- package/fesm2022/mintplayer-ng-spark-auth-register.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-reset-password.mjs +223 -0
- package/fesm2022/mintplayer-ng-spark-auth-reset-password.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-routes.mjs +194 -0
- package/fesm2022/mintplayer-ng-spark-auth-routes.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-sign-in.mjs +210 -0
- package/fesm2022/mintplayer-ng-spark-auth-sign-in.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth-two-factor.mjs +218 -0
- package/fesm2022/mintplayer-ng-spark-auth-two-factor.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-auth.mjs +48 -0
- package/fesm2022/mintplayer-ng-spark-auth.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-client-operations.mjs +294 -2
- package/fesm2022/mintplayer-ng-spark-client-operations.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-identity-provider-connected-applications.mjs +389 -0
- package/fesm2022/mintplayer-ng-spark-identity-provider-connected-applications.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-identity-provider-core.mjs +204 -0
- package/fesm2022/mintplayer-ng-spark-identity-provider-core.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-identity-provider-developers.mjs +486 -0
- package/fesm2022/mintplayer-ng-spark-identity-provider-developers.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-identity-provider-management.mjs +350 -0
- package/fesm2022/mintplayer-ng-spark-identity-provider-management.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-identity-provider.mjs +66 -0
- package/fesm2022/mintplayer-ng-spark-identity-provider.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-po-detail.mjs +9 -4
- package/fesm2022/mintplayer-ng-spark-po-detail.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-pwa.mjs +162 -0
- package/fesm2022/mintplayer-ng-spark-pwa.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-services.mjs +11 -1
- package/fesm2022/mintplayer-ng-spark-services.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-shell.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark.mjs.map +1 -1
- package/package.json +99 -1
- package/types/mintplayer-ng-spark-auth-account.d.ts +255 -0
- package/types/mintplayer-ng-spark-auth-auth-bar.d.ts +22 -0
- package/types/mintplayer-ng-spark-auth-confirm-email.d.ts +21 -0
- package/types/mintplayer-ng-spark-auth-core.d.ts +197 -0
- package/types/mintplayer-ng-spark-auth-external-login.d.ts +132 -0
- package/types/mintplayer-ng-spark-auth-forgot-password.d.ts +18 -0
- package/types/mintplayer-ng-spark-auth-guards.d.ts +15 -0
- package/types/mintplayer-ng-spark-auth-interceptors.d.ts +2 -0
- package/types/mintplayer-ng-spark-auth-login.d.ts +46 -0
- package/types/mintplayer-ng-spark-auth-models.d.ts +489 -0
- package/types/mintplayer-ng-spark-auth-pipes.d.ts +8 -0
- package/types/mintplayer-ng-spark-auth-register.d.ts +21 -0
- package/types/mintplayer-ng-spark-auth-reset-password.d.ts +25 -0
- package/types/mintplayer-ng-spark-auth-routes.d.ts +154 -0
- package/types/mintplayer-ng-spark-auth-sign-in.d.ts +84 -0
- package/types/mintplayer-ng-spark-auth-two-factor.d.ts +23 -0
- package/types/mintplayer-ng-spark-auth.d.ts +24 -0
- package/types/mintplayer-ng-spark-client-operations.d.ts +78 -3
- package/types/mintplayer-ng-spark-identity-provider-connected-applications.d.ts +35 -0
- package/types/mintplayer-ng-spark-identity-provider-core.d.ts +144 -0
- package/types/mintplayer-ng-spark-identity-provider-developers.d.ts +55 -0
- package/types/mintplayer-ng-spark-identity-provider-management.d.ts +33 -0
- package/types/mintplayer-ng-spark-identity-provider.d.ts +64 -0
- package/types/mintplayer-ng-spark-pwa.d.ts +89 -0
- package/types/mintplayer-ng-spark-services.d.ts +10 -0
- package/types/mintplayer-ng-spark-shell.d.ts +2 -2
- package/types/mintplayer-ng-spark.d.ts +4 -4
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { TemplateRef } from "@angular/core";
|
|
3
|
+
import { Color } from "@mintplayer/ng-bootstrap";
|
|
4
|
+
import { SparkExternalLoginMode, SparkExternalProvider } from "@mintplayer/ng-spark/auth/models";
|
|
5
|
+
/**
|
|
6
|
+
* One provider's button, as the template sees it: the provider itself, and the call that signs in
|
|
7
|
+
* with it.
|
|
8
|
+
*
|
|
9
|
+
* **Passing the closure is the point.** A consumer never touches `provider.scheme`, so the failure
|
|
10
|
+
* this component exists to prevent — a hard-coded scheme string that silently stops matching when
|
|
11
|
+
* the server's registration changes — is unreachable by construction. It also means busy state,
|
|
12
|
+
* `returnUrl` handling and popup-versus-redirect can move behind `signIn` later without a
|
|
13
|
+
* consumer-facing change.
|
|
14
|
+
*/
|
|
15
|
+
export interface SparkProviderButtonContext {
|
|
16
|
+
$implicit: SparkExternalProviderView;
|
|
17
|
+
signIn: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a sign-in popup is open: disable the button while it is. Read from the service's
|
|
20
|
+
* `externalLoginPending`, never from the sign-in promise (D2).
|
|
21
|
+
*/
|
|
22
|
+
pending: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** A provider the server reported, merged with whatever presentation the app declared for it. */
|
|
25
|
+
export interface SparkExternalProviderView extends SparkExternalProvider {
|
|
26
|
+
iconClass?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A button per external provider the server reports, and the outcome of the last attempt with one.
|
|
30
|
+
*
|
|
31
|
+
* Shared by the sign-in landing page and the password login page, so both offer the same providers
|
|
32
|
+
* with the same behaviour. Hostable on any page of an application's own as well.
|
|
33
|
+
*
|
|
34
|
+
* The providers come from `GET /spark/auth/capabilities` rather than from a list the application
|
|
35
|
+
* hard-codes: every consumer that hand-rolled this before wrote the scheme name as a string literal,
|
|
36
|
+
* which is a silent mismatch waiting to happen the moment the server's provider registration
|
|
37
|
+
* changes. A `withExternalLogin(githubProvider())` declaration only *decorates* what the server
|
|
38
|
+
* reports — it cannot conjure a provider the server does not have.
|
|
39
|
+
*
|
|
40
|
+
* Renders nothing while the capabilities load, when they fail to load (the host decides what that
|
|
41
|
+
* means for its page), and when the server reports no providers. {@link hasProviders} tells a host
|
|
42
|
+
* which of those it is, e.g. to draw an "or" divider only when there is something to divide.
|
|
43
|
+
*/
|
|
44
|
+
export declare class SparkExternalLoginButtonsComponent {
|
|
45
|
+
private readonly authService;
|
|
46
|
+
private readonly declaredProviders;
|
|
47
|
+
private readonly route;
|
|
48
|
+
private readonly router;
|
|
49
|
+
private readonly config;
|
|
50
|
+
readonly colors: typeof Color;
|
|
51
|
+
/**
|
|
52
|
+
* Where to land after a successful external sign-in.
|
|
53
|
+
*
|
|
54
|
+
* Falls back to a `?returnUrl=` query parameter, matching what the login page already does — so a
|
|
55
|
+
* plain `<a routerLink="/sign-in" [queryParams]="{ returnUrl: '/somewhere' }">` works with no
|
|
56
|
+
* wiring, which is what a routed page needs since the router passes it no inputs. The query value
|
|
57
|
+
* is validated as a local path before use; an off-site one is dropped rather than followed.
|
|
58
|
+
*/
|
|
59
|
+
readonly returnUrl: import("@angular/core").InputSignal<string | undefined>;
|
|
60
|
+
/**
|
|
61
|
+
* Replaces the default provider button. Rendered once per provider with a
|
|
62
|
+
* {@link SparkProviderButtonContext}.
|
|
63
|
+
*/
|
|
64
|
+
readonly providerTemplate: import("@angular/core").InputSignal<TemplateRef<SparkProviderButtonContext> | null>;
|
|
65
|
+
private readonly reported;
|
|
66
|
+
/** The capabilities arrived. Until then, and when they fail, nothing renders. */
|
|
67
|
+
readonly loaded: import("@angular/core").WritableSignal<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* The translation key of the last external sign-in failure, from the popup's result or from the
|
|
70
|
+
* `?sparkExternalLogin` a redirect came back with.
|
|
71
|
+
*/
|
|
72
|
+
readonly externalError: import("@angular/core").WritableSignal<string>;
|
|
73
|
+
/** `link_confirmation_sent` travels as a failure but is news (check your mail), not an error. */
|
|
74
|
+
readonly externalErrorIsNotice: import("@angular/core").Signal<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* The provider whose popup `window.open` refused. The component then offers "Continue in this
|
|
77
|
+
* tab": the same provider in redirect mode. Not automatic (F10): in Firefox's installed web app a
|
|
78
|
+
* null handle may still have started the flow inside the app, and a redirect would run a second one.
|
|
79
|
+
*/
|
|
80
|
+
readonly blockedProvider: import("@angular/core").WritableSignal<SparkExternalProviderView | null>;
|
|
81
|
+
/**
|
|
82
|
+
* While a sign-in popup is open. The buttons follow this, not the promise: under COOP the popup
|
|
83
|
+
* reads closed long before its result arrives, and the attempt keeps listening (D2).
|
|
84
|
+
*/
|
|
85
|
+
readonly externalPending: import("@angular/core").Signal<boolean>;
|
|
86
|
+
/**
|
|
87
|
+
* The server's list, decorated and ordered by whatever the application declared. Declared-but-not-
|
|
88
|
+
* reported schemes are dropped and reported-but-not-declared ones keep a default button, so
|
|
89
|
+
* neither side can produce a provider the other does not have.
|
|
90
|
+
*/
|
|
91
|
+
readonly providers: import("@angular/core").Signal<SparkExternalProviderView[]>;
|
|
92
|
+
/** Whether the server reported at least one provider, i.e. whether this component shows buttons. */
|
|
93
|
+
readonly hasProviders: import("@angular/core").Signal<boolean>;
|
|
94
|
+
constructor();
|
|
95
|
+
private load;
|
|
96
|
+
private effectiveReturnUrl;
|
|
97
|
+
/** `popup_closed` is "not now", not an error, so it shows nothing. */
|
|
98
|
+
private showExternalError;
|
|
99
|
+
/** The closure handed to a projected template, so a consumer never names a scheme itself. */
|
|
100
|
+
contextFor(provider: SparkExternalProviderView): SparkProviderButtonContext;
|
|
101
|
+
/**
|
|
102
|
+
* Signs in, then *leaves this page*.
|
|
103
|
+
*
|
|
104
|
+
* The navigation is the part that is easy to miss. In `'popup'` mode the `returnUrl` is consumed
|
|
105
|
+
* by the popup — it tells the server where to send that window before it closes — and the opener,
|
|
106
|
+
* which is the tab the user is actually looking at, is never touched. So without this the sign-in
|
|
107
|
+
* succeeds, the topbar flips to the signed-in state, and the user is left staring at the login
|
|
108
|
+
* page wondering whether it worked.
|
|
109
|
+
*
|
|
110
|
+
* Failures deliberately do not navigate: the component renders the error, and moving away would
|
|
111
|
+
* hide it. `popup_closed` is not an error — it is "not now" — so it shows nothing. `popup_blocked`
|
|
112
|
+
* also offers "Continue in this tab" ({@link continueInThisTab}).
|
|
113
|
+
*
|
|
114
|
+
* `mode` is left out unless given, so the configured `externalLoginMode` decides.
|
|
115
|
+
*/
|
|
116
|
+
signInWith(provider: SparkExternalProviderView, mode?: SparkExternalLoginMode): Promise<void>;
|
|
117
|
+
/** Retries the provider whose popup was blocked as a full-page redirect in this tab. */
|
|
118
|
+
continueInThisTab(): Promise<void>;
|
|
119
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SparkExternalLoginButtonsComponent, never>;
|
|
120
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SparkExternalLoginButtonsComponent, "spark-external-login-buttons", never, {
|
|
121
|
+
"returnUrl": {
|
|
122
|
+
"alias": "returnUrl";
|
|
123
|
+
"required": false;
|
|
124
|
+
"isSignal": true;
|
|
125
|
+
};
|
|
126
|
+
"providerTemplate": {
|
|
127
|
+
"alias": "providerTemplate";
|
|
128
|
+
"required": false;
|
|
129
|
+
"isSignal": true;
|
|
130
|
+
};
|
|
131
|
+
}, {}, never, never, true, never>;
|
|
132
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Color } from "@mintplayer/ng-bootstrap";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SparkForgotPasswordComponent {
|
|
4
|
+
private readonly fb;
|
|
5
|
+
private readonly authService;
|
|
6
|
+
private readonly translation;
|
|
7
|
+
readonly routePaths: Partial<Record<keyof import("@mintplayer/ng-spark/auth/models").SparkAuthRouteEntries, string>>;
|
|
8
|
+
colors: typeof Color;
|
|
9
|
+
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
10
|
+
readonly errorMessage: import("@angular/core").WritableSignal<string>;
|
|
11
|
+
readonly successMessage: import("@angular/core").WritableSignal<string>;
|
|
12
|
+
readonly form: import("@angular/forms").FormGroup<{
|
|
13
|
+
email: import("@angular/forms").FormControl<string | null>;
|
|
14
|
+
}>;
|
|
15
|
+
onSubmit(): Promise<void>;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SparkForgotPasswordComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SparkForgotPasswordComponent, "spark-forgot-password", never, {}, {}, never, never, true, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CanActivateFn } from "@angular/router";
|
|
2
|
+
/**
|
|
3
|
+
* Lets a signed-in user through and sends everyone else to the sign-in page with a `returnUrl`.
|
|
4
|
+
*
|
|
5
|
+
* `SparkAuthService` reads `/me` asynchronously at start-up, so on a hard reload the user is not
|
|
6
|
+
* known to be signed in yet when the router runs this guard. When the session is not known, the
|
|
7
|
+
* guard waits for the session check before deciding, so a signed-in user is never bounced to the
|
|
8
|
+
* sign-in page. A session that is already known passes without a round trip.
|
|
9
|
+
*/
|
|
10
|
+
export declare const sparkAuthGuard: CanActivateFn;
|
|
11
|
+
/**
|
|
12
|
+
* The same guard as {@link sparkAuthGuard}. It existed separately while `sparkAuthGuard` decided
|
|
13
|
+
* before the session check had finished; both now wait for it.
|
|
14
|
+
*/
|
|
15
|
+
export declare const sparkAuthenticatedGuard: CanActivateFn;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Color } from "@mintplayer/ng-bootstrap";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SparkLoginComponent {
|
|
4
|
+
private readonly fb;
|
|
5
|
+
private readonly authService;
|
|
6
|
+
private readonly router;
|
|
7
|
+
private readonly route;
|
|
8
|
+
private readonly config;
|
|
9
|
+
private readonly translation;
|
|
10
|
+
readonly routePaths: Partial<Record<keyof import("@mintplayer/ng-spark/auth/models").SparkAuthRouteEntries, string>>;
|
|
11
|
+
colors: typeof Color;
|
|
12
|
+
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
13
|
+
readonly errorMessage: import("@angular/core").WritableSignal<string>;
|
|
14
|
+
/**
|
|
15
|
+
* The passkey button belongs here as well as on the sign-in landing page.
|
|
16
|
+
*
|
|
17
|
+
* ⚠️ Without it an application using `withLocalLogin()` can *enroll* a passkey and then have no way
|
|
18
|
+
* to use it, because the landing page it would otherwise appear on is only mounted by
|
|
19
|
+
* `withExternalLogin()`. Passkeys are independent of both features, so the button has to be
|
|
20
|
+
* reachable from whichever sign-in page the application actually mounted.
|
|
21
|
+
*/
|
|
22
|
+
readonly passkeysAvailable: import("@angular/core").WritableSignal<boolean>;
|
|
23
|
+
readonly passkeyBusy: import("@angular/core").WritableSignal<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* What the server's `SignInIdentifiers` accepts, which shapes the identifier field's label, input
|
|
26
|
+
* type and autocomplete. Both until the capabilities arrive, and when the server does not say.
|
|
27
|
+
*/
|
|
28
|
+
private readonly signInIdentifiers;
|
|
29
|
+
readonly identifierField: import("@angular/core").Signal<{
|
|
30
|
+
label: string;
|
|
31
|
+
type: string;
|
|
32
|
+
autocomplete: string;
|
|
33
|
+
}>;
|
|
34
|
+
constructor();
|
|
35
|
+
private loadCapabilities;
|
|
36
|
+
/** Same shape as {@link onSubmit}'s success path — sign in, then leave the page. */
|
|
37
|
+
signInWithPasskey(): Promise<void>;
|
|
38
|
+
readonly form: import("@angular/forms").FormGroup<{
|
|
39
|
+
email: import("@angular/forms").FormControl<string | null>;
|
|
40
|
+
password: import("@angular/forms").FormControl<string | null>;
|
|
41
|
+
rememberMe: import("@angular/forms").FormControl<boolean | null>;
|
|
42
|
+
}>;
|
|
43
|
+
onSubmit(): Promise<void>;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SparkLoginComponent, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SparkLoginComponent, "spark-login", never, {}, {}, never, never, true, never>;
|
|
46
|
+
}
|