@imtbl/passport 2.4.15-alpha.2 → 2.5.0-alpha.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/dist/browser/index.js +96 -40
- package/dist/node/index.cjs +105 -49
- package/dist/node/index.js +97 -41
- package/dist/types/Passport.d.ts +3 -1
- package/dist/types/authManager.d.ts +3 -1
- package/dist/types/confirmation/embeddedLoginPrompt.d.ts +10 -0
- package/dist/types/confirmation/index.d.ts +1 -0
- package/dist/types/confirmation/types.d.ts +19 -3
- package/dist/types/overlay/{index.d.ts → confirmationOverlay.d.ts} +1 -1
- package/dist/types/overlay/confirmationOverlay.test.d.ts +1 -0
- package/dist/types/overlay/constants.d.ts +1 -0
- package/dist/types/overlay/elements.d.ts +2 -0
- package/dist/types/overlay/embeddedLoginPromptOverlay.d.ts +7 -0
- package/dist/types/overlay/embeddedLoginPromptOverlay.test.d.ts +1 -0
- package/dist/types/types.d.ts +1 -1
- package/package.json +7 -7
- /package/dist/types/{overlay/overlay.test.d.ts → confirmation/embeddedLoginPrompt.test.d.ts} +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { DirectLoginOptions, User, DeviceTokenResponse, UserZkEvm, UserImx } from './types';
|
|
2
2
|
import { PassportConfiguration } from './config';
|
|
3
|
+
import { EmbeddedLoginPrompt } from './confirmation';
|
|
3
4
|
export default class AuthManager {
|
|
4
5
|
private userManager;
|
|
5
6
|
private deviceCredentialsManager;
|
|
6
7
|
private readonly config;
|
|
8
|
+
private readonly embeddedLoginPrompt;
|
|
7
9
|
private readonly logoutMode;
|
|
8
10
|
/**
|
|
9
11
|
* Promise that is used to prevent multiple concurrent calls to the refresh token endpoint.
|
|
10
12
|
*/
|
|
11
13
|
private refreshingPromise;
|
|
12
|
-
constructor(config: PassportConfiguration);
|
|
14
|
+
constructor(config: PassportConfiguration, embeddedLoginPrompt: EmbeddedLoginPrompt);
|
|
13
15
|
private static mapOidcUserToDomainModel;
|
|
14
16
|
private static mapDeviceTokenResponseToOidcUser;
|
|
15
17
|
private buildExtraQueryParams;
|
|
@@ -0,0 +1,10 @@
|
|
|
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,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { DirectLoginMethod, MarketingConsentStatus } from '../types';
|
|
2
|
+
export declare enum ConfirmationSendMessage {
|
|
2
3
|
CONFIRMATION_START = "confirmation_start"
|
|
3
4
|
}
|
|
4
|
-
export declare enum
|
|
5
|
+
export declare enum ConfirmationReceiveMessage {
|
|
5
6
|
CONFIRMATION_WINDOW_READY = "confirmation_window_ready",
|
|
6
7
|
TRANSACTION_CONFIRMED = "transaction_confirmed",
|
|
7
8
|
TRANSACTION_ERROR = "transaction_error",
|
|
@@ -10,7 +11,22 @@ export declare enum ReceiveMessage {
|
|
|
10
11
|
MESSAGE_ERROR = "message_error",
|
|
11
12
|
MESSAGE_REJECTED = "message_rejected"
|
|
12
13
|
}
|
|
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
|
+
}
|
|
13
19
|
export type ConfirmationResult = {
|
|
14
20
|
confirmed: boolean;
|
|
15
21
|
};
|
|
16
|
-
export
|
|
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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const PASSPORT_OVERLAY_ID = "passport-overlay";
|
|
2
|
+
export declare const PASSPORT_OVERLAY_CONTENTS_ID = "passport-overlay-contents";
|
|
2
3
|
export declare const PASSPORT_OVERLAY_CLOSE_ID = "passport-overlay-close";
|
|
3
4
|
export declare const PASSPORT_OVERLAY_TRY_AGAIN_ID = "passport-overlay-try-again";
|
|
4
5
|
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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export interface PassportOverrides {
|
|
|
79
79
|
export interface PopupOverlayOptions {
|
|
80
80
|
disableGenericPopupOverlay?: boolean;
|
|
81
81
|
disableBlockedPopupOverlay?: boolean;
|
|
82
|
+
disableHeadlessLoginPromptOverlay?: boolean;
|
|
82
83
|
}
|
|
83
84
|
export interface PassportModuleConfiguration extends ModuleConfiguration<PassportOverrides>, OidcConfiguration {
|
|
84
85
|
/**
|
|
@@ -157,7 +158,6 @@ export declare enum MarketingConsentStatus {
|
|
|
157
158
|
Unsubscribed = "unsubscribed"
|
|
158
159
|
}
|
|
159
160
|
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.
|
|
4
|
+
"version": "2.5.0-alpha.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.
|
|
11
|
-
"@imtbl/generated-clients": "2.
|
|
12
|
-
"@imtbl/metrics": "2.
|
|
13
|
-
"@imtbl/toolkit": "2.
|
|
14
|
-
"@imtbl/x-client": "2.
|
|
15
|
-
"@imtbl/x-provider": "2.
|
|
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",
|
|
16
16
|
"@magic-ext/oidc": "12.0.5",
|
|
17
17
|
"@magic-sdk/provider": "^29.0.5",
|
|
18
18
|
"@metamask/detect-provider": "^2.0.0",
|
/package/dist/types/{overlay/overlay.test.d.ts → confirmation/embeddedLoginPrompt.test.d.ts}
RENAMED
|
File without changes
|