@imtbl/passport 2.5.0-alpha.0 → 2.6.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,17 +1,15 @@
1
1
  import { DirectLoginOptions, User, DeviceTokenResponse, UserZkEvm, UserImx } from './types';
2
2
  import { PassportConfiguration } from './config';
3
- import { EmbeddedLoginPrompt } from './confirmation';
4
3
  export default class AuthManager {
5
4
  private userManager;
6
5
  private deviceCredentialsManager;
7
6
  private readonly config;
8
- private readonly embeddedLoginPrompt;
9
7
  private readonly logoutMode;
10
8
  /**
11
9
  * Promise that is used to prevent multiple concurrent calls to the refresh token endpoint.
12
10
  */
13
11
  private refreshingPromise;
14
- constructor(config: PassportConfiguration, embeddedLoginPrompt: EmbeddedLoginPrompt);
12
+ constructor(config: PassportConfiguration);
15
13
  private static mapOidcUserToDomainModel;
16
14
  private static mapDeviceTokenResponseToOidcUser;
17
15
  private buildExtraQueryParams;
@@ -1,3 +1,2 @@
1
1
  export { default as ConfirmationScreen } from './confirmation';
2
- export { default as EmbeddedLoginPrompt } from './embeddedLoginPrompt';
3
2
  export * from './types';
@@ -1,8 +1,7 @@
1
- import { DirectLoginMethod, MarketingConsentStatus } from '../types';
2
- export declare enum ConfirmationSendMessage {
1
+ export declare enum SendMessage {
3
2
  CONFIRMATION_START = "confirmation_start"
4
3
  }
5
- export declare enum ConfirmationReceiveMessage {
4
+ export declare enum ReceiveMessage {
6
5
  CONFIRMATION_WINDOW_READY = "confirmation_window_ready",
7
6
  TRANSACTION_CONFIRMED = "transaction_confirmed",
8
7
  TRANSACTION_ERROR = "transaction_error",
@@ -11,22 +10,7 @@ export declare enum ConfirmationReceiveMessage {
11
10
  MESSAGE_ERROR = "message_error",
12
11
  MESSAGE_REJECTED = "message_rejected"
13
12
  }
14
- export declare enum EmbeddedLoginPromptReceiveMessage {
15
- LOGIN_METHOD_SELECTED = "login_method_selected",
16
- LOGIN_PROMPT_ERROR = "login_prompt_error",
17
- LOGIN_PROMPT_CLOSED = "login_prompt_closed"
18
- }
19
13
  export type ConfirmationResult = {
20
14
  confirmed: boolean;
21
15
  };
22
- export type EmbeddedLoginPromptResult = {
23
- marketingConsentStatus: MarketingConsentStatus;
24
- } & ({
25
- directLoginMethod: 'email';
26
- email: string;
27
- } | {
28
- directLoginMethod: Exclude<DirectLoginMethod, 'email'>;
29
- email?: never;
30
- });
31
- export declare const PASSPORT_CONFIRMATION_EVENT_TYPE = "imx_passport_confirmation";
32
- export declare const EMBEDDED_LOGIN_PROMPT_EVENT_TYPE = "im_passport_embedded_login_prompt";
16
+ export declare const PASSPORT_EVENT_TYPE = "imx_passport_confirmation";
@@ -1,5 +1,4 @@
1
1
  export declare const PASSPORT_OVERLAY_ID = "passport-overlay";
2
- export declare const PASSPORT_OVERLAY_CONTENTS_ID = "passport-overlay-contents";
3
2
  export declare const PASSPORT_OVERLAY_CLOSE_ID = "passport-overlay-close";
4
3
  export declare const PASSPORT_OVERLAY_TRY_AGAIN_ID = "passport-overlay-try-again";
5
4
  export declare const CLOSE_BUTTON_SVG = "\n <svg\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style=\"width: 20px !important;\"\n >\n <path\n d=\"M16.25 5.75833L14.2417 3.75L10 7.99167L5.75833 3.75L3.75 5.75833L7.99167 10L3.75 14.2417L5.75833 16.25L10 12.0083L14.2417 16.25L16.25 14.2417L12.0083 10L16.25 5.75833Z\"\n fill=\"#F3F3F3\"\n />\n </svg>\n";
@@ -1,5 +1,3 @@
1
- export declare const getOverlay: (contents: string) => string;
2
- export declare const getEmbeddedLoginPromptOverlay: () => string;
3
1
  type LinkParams = {
4
2
  id: string;
5
3
  href: string;
@@ -1,5 +1,5 @@
1
1
  import { PopupOverlayOptions } from '../types';
2
- export default class ConfirmationOverlay {
2
+ export default class Overlay {
3
3
  private disableGenericPopupOverlay;
4
4
  private disableBlockedPopupOverlay;
5
5
  private overlay;
@@ -79,7 +79,6 @@ export interface PassportOverrides {
79
79
  export interface PopupOverlayOptions {
80
80
  disableGenericPopupOverlay?: boolean;
81
81
  disableBlockedPopupOverlay?: boolean;
82
- disableHeadlessLoginPromptOverlay?: boolean;
83
82
  }
84
83
  export interface PassportModuleConfiguration extends ModuleConfiguration<PassportOverrides>, OidcConfiguration {
85
84
  /**
@@ -158,6 +157,7 @@ export declare enum MarketingConsentStatus {
158
157
  Unsubscribed = "unsubscribed"
159
158
  }
160
159
  export type DirectLoginOptions = {
160
+ directLoginMethod: DirectLoginMethod;
161
161
  marketingConsentStatus?: MarketingConsentStatus;
162
162
  } & ({
163
163
  directLoginMethod: 'email';
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@imtbl/passport",
3
3
  "description": "Passport module for Immutable SDK",
4
- "version": "2.5.0-alpha.0",
4
+ "version": "2.6.0",
5
5
  "author": "Immutable",
6
6
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
7
7
  "dependencies": {
8
8
  "@0xsequence/abi": "^2.0.25",
9
9
  "@0xsequence/core": "^2.0.25",
10
- "@imtbl/config": "2.5.0-alpha.0",
11
- "@imtbl/generated-clients": "2.5.0-alpha.0",
12
- "@imtbl/metrics": "2.5.0-alpha.0",
13
- "@imtbl/toolkit": "2.5.0-alpha.0",
14
- "@imtbl/x-client": "2.5.0-alpha.0",
15
- "@imtbl/x-provider": "2.5.0-alpha.0",
10
+ "@imtbl/config": "2.6.0",
11
+ "@imtbl/generated-clients": "2.6.0",
12
+ "@imtbl/metrics": "2.6.0",
13
+ "@imtbl/toolkit": "2.6.0",
14
+ "@imtbl/x-client": "2.6.0",
15
+ "@imtbl/x-provider": "2.6.0",
16
16
  "@magic-ext/oidc": "12.0.5",
17
17
  "@magic-sdk/provider": "^29.0.5",
18
18
  "@metamask/detect-provider": "^2.0.0",
@@ -1,10 +0,0 @@
1
- import { PassportConfiguration } from '../config';
2
- import { DirectLoginOptions } from '../types';
3
- export default class EmbeddedLoginPrompt {
4
- private config;
5
- constructor(config: PassportConfiguration);
6
- private getHref;
7
- private static appendIFrameStylesIfNeeded;
8
- private getEmbeddedLoginIFrame;
9
- displayEmbeddedLoginPrompt(): Promise<DirectLoginOptions>;
10
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- export default class EmbeddedLoginPromptOverlay {
2
- private static overlay;
3
- private static onCloseListener;
4
- private static closeButton;
5
- static remove(): void;
6
- static appendOverlay(embeddedLoginPrompt: HTMLIFrameElement, onCloseListener: () => void): void;
7
- }