@atlasauth/angular 0.6.1 → 0.8.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.
@@ -1,4 +1,4 @@
1
- import type { SignOutEvent } from '@atlasauth/js';
1
+ import type { ReferralConsent, SignOutEvent } from '@atlasauth/js';
2
2
  import { InjectionToken } from '@angular/core';
3
3
  import type { Appearance } from './appearance';
4
4
  import type { Catalog } from './i18n';
@@ -9,6 +9,18 @@ import type { Catalog } from './i18n';
9
9
  export interface AtlasOptions {
10
10
  /** The instance's publishable key (`pk_…`). Required. */
11
11
  publishableKey: string;
12
+ /**
13
+ * Referral attribution: the prebuilt forms send the referral the visitor
14
+ * arrived with on sign-in / sign-up when the instance has referrals on.
15
+ * `false` turns that off.
16
+ */
17
+ referral?: false;
18
+ /**
19
+ * The app's own consent decision for the referral tracking cookie, used only
20
+ * when Cookie Munch is not on the page: `'granted'` (or a function returning
21
+ * it) lets the forms read the cookie. Default: the cookie is not read.
22
+ */
23
+ referralConsent?: ReferralConsent;
12
24
  /**
13
25
  * The instance's Frontend API: an absolute URL such as
14
26
  * `"https://auth.example.com"`, or `"same-origin"` / a path such as `"/atlas"`
@@ -166,7 +166,8 @@ export declare class AtlasService implements OnDestroy {
166
166
  */
167
167
  setActiveOrganization(organizationId: string | null): Promise<void>;
168
168
  /** Re-read `/v1/client`: refresh user, session, memberships and status. */
169
- reload(): Promise<void>;
169
+ /** Re-boot from the Frontend API. Resolves true when a session now exists in this browser. */
170
+ reload(): Promise<boolean>;
170
171
  /**
171
172
  * §6.3 step 3: complete a redirect-based sign-in, then boot. An OAuth or
172
173
  * hosted-page flow lands back with a one-time ticket in the URL; exchange it
@@ -9,7 +9,7 @@ import * as i0 from "@angular/core";
9
9
  * minor. For a `message` row, `labelKey` carries the message's i18n key.
10
10
  */
11
11
  interface StepField {
12
- kind: 'input' | 'message';
12
+ kind: 'input' | 'message' | 'alert';
13
13
  name: string;
14
14
  labelKey: string;
15
15
  type: string;
@@ -29,6 +29,8 @@ export declare class AttemptFlowComponent {
29
29
  attempt: AttemptView | null;
30
30
  busy: boolean;
31
31
  errors: FieldError[];
32
+ /** `FlowState.sessionKept`: whether this browser kept the session the sign-in created. */
33
+ sessionKept: boolean | undefined;
32
34
  titleKey: string;
33
35
  /**
34
36
  * The sign-in captcha, drawn above the submit button on the identifier step
@@ -67,6 +69,6 @@ export declare class AttemptFlowComponent {
67
69
  protected showSubmit(): boolean;
68
70
  protected fields(): StepField[];
69
71
  static ɵfac: i0.ɵɵFactoryDeclaration<AttemptFlowComponent, never>;
70
- static ɵcmp: i0.ɵɵComponentDeclaration<AttemptFlowComponent, "atlas-attempt-flow", never, { "attempt": { "alias": "attempt"; "required": false; }; "busy": { "alias": "busy"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "titleKey": { "alias": "titleKey"; "required": false; }; "captcha": { "alias": "captcha"; "required": false; }; "firstFactors": { "alias": "firstFactors"; "required": false; }; "preparedFactor": { "alias": "preparedFactor"; "required": false; }; }, { "submitFlow": "submitFlow"; "chooseFactor": "chooseFactor"; }, never, never, true, never>;
72
+ static ɵcmp: i0.ɵɵComponentDeclaration<AttemptFlowComponent, "atlas-attempt-flow", never, { "attempt": { "alias": "attempt"; "required": false; }; "busy": { "alias": "busy"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "sessionKept": { "alias": "sessionKept"; "required": false; }; "titleKey": { "alias": "titleKey"; "required": false; }; "captcha": { "alias": "captcha"; "required": false; }; "firstFactors": { "alias": "firstFactors"; "required": false; }; "preparedFactor": { "alias": "preparedFactor"; "required": false; }; }, { "submitFlow": "submitFlow"; "chooseFactor": "chooseFactor"; }, never, never, true, never>;
71
73
  }
72
74
  export {};
@@ -42,7 +42,7 @@ export declare class AtlasFlowController {
42
42
  readonly preparedFactor: WritableSignal<"email_code">;
43
43
  private pollTimer;
44
44
  private identifier;
45
- constructor(client: FapiClient, reload: () => Promise<void>, pending: {
45
+ constructor(client: FapiClient, reload: () => Promise<boolean>, pending: {
46
46
  id: string;
47
47
  status: string;
48
48
  } | null,
@@ -15,9 +15,17 @@ export declare class SignInComponent implements OnInit, OnDestroy {
15
15
  private readonly atlas;
16
16
  /** Where to send the user once the flow completes. Reserved for host routing. */
17
17
  afterUrl?: string;
18
+ /**
19
+ * Where "No account? Sign up" goes. Default: the instance's hosted sign-up
20
+ * page (carrying the visitor's referral). `null` hides it. Always shown, never
21
+ * only after a failed sign-in, so it says nothing about whether an email has an account.
22
+ */
23
+ signUpUrl?: string | null;
24
+ protected t(key: string): string;
25
+ protected signUpHref(): string | null;
18
26
  protected readonly flow: AtlasFlowController;
19
27
  ngOnInit(): void;
20
28
  ngOnDestroy(): void;
21
29
  static ɵfac: i0.ɵɵFactoryDeclaration<SignInComponent, never>;
22
- static ɵcmp: i0.ɵɵComponentDeclaration<SignInComponent, "atlas-sign-in", never, { "afterUrl": { "alias": "afterUrl"; "required": false; }; }, {}, never, never, true, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<SignInComponent, "atlas-sign-in", never, { "afterUrl": { "alias": "afterUrl"; "required": false; }; "signUpUrl": { "alias": "signUpUrl"; "required": false; }; }, {}, never, never, true, never>;
23
31
  }
@@ -1,4 +1,4 @@
1
1
  import type { AtlasSdkInfo } from '@atlasauth/js';
2
2
  /** This package's version, sent as `X-Atlas-SDK` (kept in step with package.json by a test). */
3
- export declare const ATLAS_ANGULAR_VERSION = "0.6.1";
3
+ export declare const ATLAS_ANGULAR_VERSION = "0.8.0";
4
4
  export declare const ATLAS_ANGULAR_SDK: AtlasSdkInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlasauth/angular",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
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/authz": "0.1.1",
24
- "@atlasauth/js": "0.12.0"
23
+ "@atlasauth/js": "0.15.0",
24
+ "@atlasauth/authz": "0.1.1"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@angular/core": ">=17",