@embarkai/ui-kit 0.2.5 → 0.2.7
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +4 -8
- package/dist/iframe/main.js.map +1 -1
- package/dist/index.cjs +84 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +84 -63
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -663,6 +663,12 @@ declare class IframeManager {
|
|
|
663
663
|
* Setup visibility change handler to check channel when tab becomes visible
|
|
664
664
|
*/
|
|
665
665
|
private setupVisibilityHandler;
|
|
666
|
+
/**
|
|
667
|
+
* Normalize legacy message types from cached iframe versions.
|
|
668
|
+
* Old iframe sends LUMIA_PASSPORT_*, new iframe sends IFRAME_MSG_*.
|
|
669
|
+
* This ensures both work until all browser caches expire.
|
|
670
|
+
*/
|
|
671
|
+
private normalizeMessageType;
|
|
666
672
|
/**
|
|
667
673
|
* Handle incoming postMessage events
|
|
668
674
|
*/
|
|
@@ -1660,12 +1666,19 @@ declare global {
|
|
|
1660
1666
|
}
|
|
1661
1667
|
}
|
|
1662
1668
|
|
|
1669
|
+
interface AuthProviderMeta extends Record<string, unknown> {
|
|
1670
|
+
walletName?: string;
|
|
1671
|
+
walletType?: string;
|
|
1672
|
+
chainId?: number;
|
|
1673
|
+
email?: string;
|
|
1674
|
+
}
|
|
1663
1675
|
interface AuthProvider {
|
|
1664
1676
|
provider: 'passkey' | 'email' | 'telegram' | 'google' | 'discord' | 'twitter' | 'wallet';
|
|
1665
1677
|
verified: boolean;
|
|
1666
1678
|
linkedAt: string;
|
|
1667
1679
|
lastUsedAt?: string;
|
|
1668
1680
|
externalId: string;
|
|
1681
|
+
meta?: AuthProviderMeta;
|
|
1669
1682
|
}
|
|
1670
1683
|
|
|
1671
1684
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -663,6 +663,12 @@ declare class IframeManager {
|
|
|
663
663
|
* Setup visibility change handler to check channel when tab becomes visible
|
|
664
664
|
*/
|
|
665
665
|
private setupVisibilityHandler;
|
|
666
|
+
/**
|
|
667
|
+
* Normalize legacy message types from cached iframe versions.
|
|
668
|
+
* Old iframe sends LUMIA_PASSPORT_*, new iframe sends IFRAME_MSG_*.
|
|
669
|
+
* This ensures both work until all browser caches expire.
|
|
670
|
+
*/
|
|
671
|
+
private normalizeMessageType;
|
|
666
672
|
/**
|
|
667
673
|
* Handle incoming postMessage events
|
|
668
674
|
*/
|
|
@@ -1660,12 +1666,19 @@ declare global {
|
|
|
1660
1666
|
}
|
|
1661
1667
|
}
|
|
1662
1668
|
|
|
1669
|
+
interface AuthProviderMeta extends Record<string, unknown> {
|
|
1670
|
+
walletName?: string;
|
|
1671
|
+
walletType?: string;
|
|
1672
|
+
chainId?: number;
|
|
1673
|
+
email?: string;
|
|
1674
|
+
}
|
|
1663
1675
|
interface AuthProvider {
|
|
1664
1676
|
provider: 'passkey' | 'email' | 'telegram' | 'google' | 'discord' | 'twitter' | 'wallet';
|
|
1665
1677
|
verified: boolean;
|
|
1666
1678
|
linkedAt: string;
|
|
1667
1679
|
lastUsedAt?: string;
|
|
1668
1680
|
externalId: string;
|
|
1681
|
+
meta?: AuthProviderMeta;
|
|
1669
1682
|
}
|
|
1670
1683
|
|
|
1671
1684
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2713,12 +2713,13 @@ function useListenIframeAuthEvents() {
|
|
|
2713
2713
|
const setIsIframeReady = useSession((state) => state.setIsIframeReady);
|
|
2714
2714
|
const handleIframeMessage = useCallback4(
|
|
2715
2715
|
(event) => {
|
|
2716
|
-
|
|
2716
|
+
const type = event.data?.type?.startsWith?.("LUMIA_PASSPORT_") ? event.data.type.replace("LUMIA_PASSPORT_", "IFRAME_MSG_") : event.data?.type;
|
|
2717
|
+
if (type === "IFRAME_MSG_IFRAME_READY") {
|
|
2717
2718
|
console.log("[ IFRAME MESSAGE CACTHED ] Iframe is ready");
|
|
2718
2719
|
setIsIframeReady(true);
|
|
2719
|
-
} else if (
|
|
2720
|
+
} else if (type === "IFRAME_MSG_SHOW_IFRAME") {
|
|
2720
2721
|
console.log("[ IFRAME MESSAGE CACTHED ] Consent screen shown - hiding auth modal");
|
|
2721
|
-
} else if (
|
|
2722
|
+
} else if (type === "IFRAME_MSG_HIDE_IFRAME") {
|
|
2722
2723
|
console.log("[ IFRAME MESSAGE CACTHED ] Consent screen hidden");
|
|
2723
2724
|
} else if (event.data?.type === "KEYSHARE_RECOVERY_NEEDED") {
|
|
2724
2725
|
console.log("[ IFRAME MESSAGE CACTHED] recovery neede");
|
|
@@ -10524,6 +10525,12 @@ var init_useLinkTelegram = __esm({
|
|
|
10524
10525
|
// src/internal/components/ManageWalletMenu/ProviderCard.tsx
|
|
10525
10526
|
import { CheckCircle, Clock, Trash2 } from "lucide-react";
|
|
10526
10527
|
import { jsx as jsx55, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10528
|
+
function formatExternalId(provider, externalId) {
|
|
10529
|
+
if (provider === "wallet" && externalId.startsWith("0x") && externalId.length >= 14) {
|
|
10530
|
+
return `${externalId.slice(0, 10)}...${externalId.slice(-4)}`;
|
|
10531
|
+
}
|
|
10532
|
+
return externalId;
|
|
10533
|
+
}
|
|
10527
10534
|
function ProviderCard(props) {
|
|
10528
10535
|
const { t } = useT();
|
|
10529
10536
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
@@ -10544,13 +10551,14 @@ function ProviderCard(props) {
|
|
|
10544
10551
|
return /* @__PURE__ */ jsxs48("div", { className: "w-full flex items-center justify-between gap-[var(--ui-kit-gap)]", children: [
|
|
10545
10552
|
/* @__PURE__ */ jsx55("div", { className: "w-12 h-12 flex items-center justify-center flex-none border border-[var(--ui-kit-bd)] rounded-full", children: /* @__PURE__ */ jsx55(IconComponent, { className: "w-5 h-5" }) }),
|
|
10546
10553
|
/* @__PURE__ */ jsxs48("div", { className: "flex flex-col gap-1 flex-1", children: [
|
|
10547
|
-
/* @__PURE__ */ jsx55("span", { className: "block w-full text-[10px] font-medium", children: info.name }),
|
|
10554
|
+
/* @__PURE__ */ jsx55("span", { className: "block w-full text-[10px] font-medium", children: props.meta?.walletName || info.name }),
|
|
10548
10555
|
props.externalId && /* @__PURE__ */ jsx55(
|
|
10549
10556
|
"span",
|
|
10550
10557
|
{
|
|
10551
10558
|
style: { maxWidth: 184 },
|
|
10552
10559
|
className: "block w-full font-bold text-xs whitespace-nowrap text-ellipsis overflow-hidden",
|
|
10553
|
-
|
|
10560
|
+
title: props.externalId,
|
|
10561
|
+
children: formatExternalId(props.provider, props.externalId)
|
|
10554
10562
|
}
|
|
10555
10563
|
)
|
|
10556
10564
|
] }),
|
|
@@ -10631,19 +10639,19 @@ function ManageWalletMenu() {
|
|
|
10631
10639
|
if (name === "x") return "twitter";
|
|
10632
10640
|
return name;
|
|
10633
10641
|
};
|
|
10634
|
-
const usedProviders = fromPairs(providers.map((p) => [normalizeProviderName(p.provider), true]));
|
|
10635
10642
|
const used = [];
|
|
10636
10643
|
const unused = [];
|
|
10637
|
-
POSSIBLE_PROVIDERS.forEach((provider
|
|
10644
|
+
POSSIBLE_PROVIDERS.forEach((provider) => {
|
|
10638
10645
|
if (!configuredProviders[provider]) return;
|
|
10639
10646
|
const Icon2 = PROVIDERS_META[provider].icon;
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
+
const matches = providers.filter((p) => normalizeProviderName(p.provider) === provider);
|
|
10648
|
+
matches.forEach((providerData, idx) => {
|
|
10649
|
+
used.push(
|
|
10650
|
+
/* @__PURE__ */ jsx56(ProviderCard, { ...providerData }, `${provider}-${providerData.externalId || idx}`)
|
|
10651
|
+
);
|
|
10652
|
+
});
|
|
10653
|
+
const isMulti = MULTI_PROVIDERS.includes(provider);
|
|
10654
|
+
if (isMulti || matches.length === 0) {
|
|
10647
10655
|
unused.push(
|
|
10648
10656
|
/* @__PURE__ */ jsxs49(
|
|
10649
10657
|
Button,
|
|
@@ -10688,7 +10696,7 @@ function ManageWalletMenu() {
|
|
|
10688
10696
|
] })
|
|
10689
10697
|
]
|
|
10690
10698
|
},
|
|
10691
|
-
|
|
10699
|
+
`add-${provider}`
|
|
10692
10700
|
)
|
|
10693
10701
|
);
|
|
10694
10702
|
}
|
|
@@ -10750,7 +10758,7 @@ function ManageWalletMenu() {
|
|
|
10750
10758
|
}
|
|
10751
10759
|
);
|
|
10752
10760
|
}
|
|
10753
|
-
var POSSIBLE_PROVIDERS;
|
|
10761
|
+
var POSSIBLE_PROVIDERS, MULTI_PROVIDERS;
|
|
10754
10762
|
var init_ManageWallet = __esm({
|
|
10755
10763
|
"src/internal/components/ManageWalletMenu/ManageWallet.tsx"() {
|
|
10756
10764
|
init_useLayoutDataStore();
|
|
@@ -10778,6 +10786,7 @@ var init_ManageWallet = __esm({
|
|
|
10778
10786
|
"passkey",
|
|
10779
10787
|
"wallet"
|
|
10780
10788
|
];
|
|
10789
|
+
MULTI_PROVIDERS = ["email", "wallet"];
|
|
10781
10790
|
}
|
|
10782
10791
|
});
|
|
10783
10792
|
|
|
@@ -15470,7 +15479,7 @@ var init_package = __esm({
|
|
|
15470
15479
|
"package.json"() {
|
|
15471
15480
|
package_default = {
|
|
15472
15481
|
name: "@embarkai/ui-kit",
|
|
15473
|
-
version: "0.2.
|
|
15482
|
+
version: "0.2.7",
|
|
15474
15483
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
15475
15484
|
type: "module",
|
|
15476
15485
|
main: "./dist/index.cjs",
|
|
@@ -17823,7 +17832,7 @@ var init_iframe_manager = __esm({
|
|
|
17823
17832
|
const response = await this.sendMessage("SDK_AUTH", {
|
|
17824
17833
|
projectId: this.projectId
|
|
17825
17834
|
});
|
|
17826
|
-
if (response.type === "
|
|
17835
|
+
if (response.type === "IFRAME_MSG_SDK_AUTH_SUCCESS") {
|
|
17827
17836
|
this.channelToken = response.sessionToken;
|
|
17828
17837
|
} else {
|
|
17829
17838
|
throw new Error("SDK channel authentication failed");
|
|
@@ -17904,6 +17913,17 @@ var init_iframe_manager = __esm({
|
|
|
17904
17913
|
});
|
|
17905
17914
|
this.log("[IframeManager] Visibility handler setup");
|
|
17906
17915
|
}
|
|
17916
|
+
/**
|
|
17917
|
+
* Normalize legacy message types from cached iframe versions.
|
|
17918
|
+
* Old iframe sends LUMIA_PASSPORT_*, new iframe sends IFRAME_MSG_*.
|
|
17919
|
+
* This ensures both work until all browser caches expire.
|
|
17920
|
+
*/
|
|
17921
|
+
normalizeMessageType(type) {
|
|
17922
|
+
if (type.startsWith("LUMIA_PASSPORT_")) {
|
|
17923
|
+
return type.replace("LUMIA_PASSPORT_", "IFRAME_MSG_");
|
|
17924
|
+
}
|
|
17925
|
+
return type;
|
|
17926
|
+
}
|
|
17907
17927
|
/**
|
|
17908
17928
|
* Handle incoming postMessage events
|
|
17909
17929
|
*/
|
|
@@ -17912,24 +17932,25 @@ var init_iframe_manager = __esm({
|
|
|
17912
17932
|
if (!message || typeof message !== "object" || !message.type) {
|
|
17913
17933
|
return;
|
|
17914
17934
|
}
|
|
17935
|
+
message.type = this.normalizeMessageType(message.type);
|
|
17915
17936
|
const validIframeTypes = [
|
|
17916
|
-
"
|
|
17917
|
-
"
|
|
17918
|
-
"
|
|
17919
|
-
"
|
|
17920
|
-
"
|
|
17921
|
-
"
|
|
17922
|
-
"
|
|
17923
|
-
"
|
|
17924
|
-
"
|
|
17925
|
-
"
|
|
17926
|
-
"
|
|
17927
|
-
"
|
|
17928
|
-
"
|
|
17929
|
-
"
|
|
17930
|
-
"
|
|
17931
|
-
"
|
|
17932
|
-
"
|
|
17937
|
+
"IFRAME_MSG_IFRAME_READY",
|
|
17938
|
+
"IFRAME_MSG_WALLET_READY",
|
|
17939
|
+
"IFRAME_MSG_SHOW_IFRAME",
|
|
17940
|
+
"IFRAME_MSG_HIDE_IFRAME",
|
|
17941
|
+
"IFRAME_MSG_SDK_AUTH_SUCCESS",
|
|
17942
|
+
"IFRAME_MSG_AUTH_SUCCESS",
|
|
17943
|
+
"IFRAME_MSG_DKG_SUCCESS",
|
|
17944
|
+
"IFRAME_MSG_SIGNATURE",
|
|
17945
|
+
"IFRAME_MSG_ADDRESS",
|
|
17946
|
+
"IFRAME_MSG_KEYSHARE_STATUS",
|
|
17947
|
+
"IFRAME_MSG_TRUSTED_APPS_LIST",
|
|
17948
|
+
"IFRAME_MSG_TRUSTED_APP_REMOVED",
|
|
17949
|
+
"IFRAME_MSG_REQUEST_NEW_TOKEN",
|
|
17950
|
+
"IFRAME_MSG_TOKEN_REFRESHED",
|
|
17951
|
+
"IFRAME_MSG_HEARTBEAT_RESPONSE",
|
|
17952
|
+
"IFRAME_MSG_RESPONSE",
|
|
17953
|
+
"IFRAME_MSG_ERROR"
|
|
17933
17954
|
];
|
|
17934
17955
|
if (!validIframeTypes.includes(message.type) && !message.messageId) {
|
|
17935
17956
|
return;
|
|
@@ -17942,31 +17963,31 @@ var init_iframe_manager = __esm({
|
|
|
17942
17963
|
});
|
|
17943
17964
|
return;
|
|
17944
17965
|
}
|
|
17945
|
-
if (message.type === "
|
|
17946
|
-
this.log("[IframeManager] \u{1F4E8} Received
|
|
17966
|
+
if (message.type === "IFRAME_MSG_IFRAME_READY") {
|
|
17967
|
+
this.log("[IframeManager] \u{1F4E8} Received IFRAME_MSG_IFRAME_READY");
|
|
17947
17968
|
this.isReady = true;
|
|
17948
17969
|
this.readyResolve();
|
|
17949
17970
|
return;
|
|
17950
17971
|
}
|
|
17951
|
-
if (message.type === "
|
|
17952
|
-
this.log("[IframeManager] \u{1F4E8} Received
|
|
17972
|
+
if (message.type === "IFRAME_MSG_WALLET_READY") {
|
|
17973
|
+
this.log("[IframeManager] \u{1F4E8} Received IFRAME_MSG_WALLET_READY", message.data);
|
|
17953
17974
|
if (this.onWalletReadyCallback) {
|
|
17954
17975
|
this.onWalletReadyCallback(message.data);
|
|
17955
17976
|
}
|
|
17956
17977
|
return;
|
|
17957
17978
|
}
|
|
17958
|
-
if (message.type === "
|
|
17959
|
-
this.log("[IframeManager] \u{1F4E8} Received
|
|
17979
|
+
if (message.type === "IFRAME_MSG_SHOW_IFRAME") {
|
|
17980
|
+
this.log("[IframeManager] \u{1F4E8} Received IFRAME_MSG_SHOW_IFRAME");
|
|
17960
17981
|
this.showIframe();
|
|
17961
17982
|
return;
|
|
17962
17983
|
}
|
|
17963
|
-
if (message.type === "
|
|
17964
|
-
this.log("[IframeManager] \u{1F4E8} Received
|
|
17984
|
+
if (message.type === "IFRAME_MSG_HIDE_IFRAME") {
|
|
17985
|
+
this.log("[IframeManager] \u{1F4E8} Received IFRAME_MSG_HIDE_IFRAME");
|
|
17965
17986
|
this.hideIframe();
|
|
17966
17987
|
return;
|
|
17967
17988
|
}
|
|
17968
|
-
if (message.type === "
|
|
17969
|
-
this.log("[IframeManager] \u{1F4E8} Received
|
|
17989
|
+
if (message.type === "IFRAME_MSG_REQUEST_NEW_TOKEN") {
|
|
17990
|
+
this.log("[IframeManager] \u{1F4E8} Received IFRAME_MSG_REQUEST_NEW_TOKEN");
|
|
17970
17991
|
this.handleTokenRefreshRequest(message).catch((error) => {
|
|
17971
17992
|
this.log("[IframeManager] \u274C Token refresh error:", error);
|
|
17972
17993
|
});
|
|
@@ -17976,7 +17997,7 @@ var init_iframe_manager = __esm({
|
|
|
17976
17997
|
const pending = this.pendingRequests.get(message.messageId);
|
|
17977
17998
|
if (pending) {
|
|
17978
17999
|
this.pendingRequests.delete(message.messageId);
|
|
17979
|
-
if (message.type === "
|
|
18000
|
+
if (message.type === "IFRAME_MSG_ERROR") {
|
|
17980
18001
|
const passportError = createAccountAbstractionError({
|
|
17981
18002
|
message: message.error || "Unknown error",
|
|
17982
18003
|
code: message.code
|
|
@@ -18001,7 +18022,7 @@ var init_iframe_manager = __esm({
|
|
|
18001
18022
|
const iframeOrigin = new URL(this.iframeUrl).origin;
|
|
18002
18023
|
this.iframe.contentWindow.postMessage(
|
|
18003
18024
|
{
|
|
18004
|
-
type: "
|
|
18025
|
+
type: "IFRAME_MSG_TOKEN_REFRESHED",
|
|
18005
18026
|
messageId: message.messageId,
|
|
18006
18027
|
accessToken: newAccessToken,
|
|
18007
18028
|
timestamp: Date.now()
|
|
@@ -18014,7 +18035,7 @@ var init_iframe_manager = __esm({
|
|
|
18014
18035
|
const iframeOrigin = new URL(this.iframeUrl).origin;
|
|
18015
18036
|
this.iframe.contentWindow.postMessage(
|
|
18016
18037
|
{
|
|
18017
|
-
type: "
|
|
18038
|
+
type: "IFRAME_MSG_TOKEN_REFRESHED",
|
|
18018
18039
|
messageId: message.messageId,
|
|
18019
18040
|
error: "Token refresh failed",
|
|
18020
18041
|
timestamp: Date.now()
|
|
@@ -18028,7 +18049,7 @@ var init_iframe_manager = __esm({
|
|
|
18028
18049
|
const iframeOrigin = new URL(this.iframeUrl).origin;
|
|
18029
18050
|
this.iframe.contentWindow.postMessage(
|
|
18030
18051
|
{
|
|
18031
|
-
type: "
|
|
18052
|
+
type: "IFRAME_MSG_TOKEN_REFRESHED",
|
|
18032
18053
|
messageId: message.messageId,
|
|
18033
18054
|
error: error instanceof Error ? error.message : "Unknown error",
|
|
18034
18055
|
timestamp: Date.now()
|
|
@@ -18279,7 +18300,7 @@ var init_iframe_manager = __esm({
|
|
|
18279
18300
|
avatar,
|
|
18280
18301
|
displayName
|
|
18281
18302
|
});
|
|
18282
|
-
if (response.type === "
|
|
18303
|
+
if (response.type === "IFRAME_MSG_AUTH_SUCCESS") {
|
|
18283
18304
|
return {
|
|
18284
18305
|
userId: response.userId,
|
|
18285
18306
|
address: response.address
|
|
@@ -18297,7 +18318,7 @@ var init_iframe_manager = __esm({
|
|
|
18297
18318
|
accessToken
|
|
18298
18319
|
// Pass access token for TSS API authentication
|
|
18299
18320
|
});
|
|
18300
|
-
if (response.type === "
|
|
18321
|
+
if (response.type === "IFRAME_MSG_DKG_SUCCESS") {
|
|
18301
18322
|
return response.ownerAddress;
|
|
18302
18323
|
}
|
|
18303
18324
|
throw new Error("DKG failed");
|
|
@@ -18320,7 +18341,7 @@ var init_iframe_manager = __esm({
|
|
|
18320
18341
|
avatar,
|
|
18321
18342
|
displayName
|
|
18322
18343
|
});
|
|
18323
|
-
if (response.type === "
|
|
18344
|
+
if (response.type === "IFRAME_MSG_SIGNATURE") {
|
|
18324
18345
|
return response.signature;
|
|
18325
18346
|
}
|
|
18326
18347
|
throw new Error("Transaction signing failed");
|
|
@@ -18353,7 +18374,7 @@ var init_iframe_manager = __esm({
|
|
|
18353
18374
|
type: response.type,
|
|
18354
18375
|
hasSignature: !!response.signature
|
|
18355
18376
|
});
|
|
18356
|
-
if (response.type === "
|
|
18377
|
+
if (response.type === "IFRAME_MSG_EIP712_SIGNATURE") {
|
|
18357
18378
|
return response.signature;
|
|
18358
18379
|
}
|
|
18359
18380
|
throw new Error("EIP712 signing failed");
|
|
@@ -18365,7 +18386,7 @@ var init_iframe_manager = __esm({
|
|
|
18365
18386
|
const response = await this.sendMessage("GET_ADDRESS", {
|
|
18366
18387
|
userId
|
|
18367
18388
|
});
|
|
18368
|
-
if (response.type === "
|
|
18389
|
+
if (response.type === "IFRAME_MSG_ADDRESS") {
|
|
18369
18390
|
return response.address;
|
|
18370
18391
|
}
|
|
18371
18392
|
return void 0;
|
|
@@ -18377,7 +18398,7 @@ var init_iframe_manager = __esm({
|
|
|
18377
18398
|
const response = await this.sendMessage("CHECK_KEYSHARE", {
|
|
18378
18399
|
userId
|
|
18379
18400
|
});
|
|
18380
|
-
if (response.type === "
|
|
18401
|
+
if (response.type === "IFRAME_MSG_KEYSHARE_STATUS") {
|
|
18381
18402
|
return {
|
|
18382
18403
|
hasKeyshare: response.hasKeyshare,
|
|
18383
18404
|
address: response.address
|
|
@@ -18773,7 +18794,7 @@ var init_iframe_manager = __esm({
|
|
|
18773
18794
|
const response = await this.sendMessage("GET_TRUSTED_APPS", {
|
|
18774
18795
|
userId
|
|
18775
18796
|
});
|
|
18776
|
-
if (response.type === "
|
|
18797
|
+
if (response.type === "IFRAME_MSG_TRUSTED_APPS_LIST") {
|
|
18777
18798
|
return response.apps || [];
|
|
18778
18799
|
}
|
|
18779
18800
|
return [];
|
|
@@ -18787,7 +18808,7 @@ var init_iframe_manager = __esm({
|
|
|
18787
18808
|
projectId,
|
|
18788
18809
|
appOrigin: origin
|
|
18789
18810
|
});
|
|
18790
|
-
if (response.type === "
|
|
18811
|
+
if (response.type === "IFRAME_MSG_TRUSTED_APP_REMOVED") {
|
|
18791
18812
|
return response.success;
|
|
18792
18813
|
}
|
|
18793
18814
|
return false;
|
|
@@ -18818,7 +18839,7 @@ var init_iframe_manager = __esm({
|
|
|
18818
18839
|
accessToken
|
|
18819
18840
|
// Pass access token for TSS API authentication
|
|
18820
18841
|
});
|
|
18821
|
-
if (response.type === "
|
|
18842
|
+
if (response.type === "IFRAME_MSG_BACKUP_CREATED") {
|
|
18822
18843
|
return response.result;
|
|
18823
18844
|
}
|
|
18824
18845
|
throw new Error("Unexpected response type");
|
|
@@ -18833,7 +18854,7 @@ var init_iframe_manager = __esm({
|
|
|
18833
18854
|
accessToken
|
|
18834
18855
|
// Pass access token for TSS API authentication
|
|
18835
18856
|
});
|
|
18836
|
-
if (response.type === "
|
|
18857
|
+
if (response.type === "IFRAME_MSG_BACKUP_RESTORED") {
|
|
18837
18858
|
return response.result;
|
|
18838
18859
|
}
|
|
18839
18860
|
throw new Error("Unexpected response type");
|
|
@@ -18847,7 +18868,7 @@ var init_iframe_manager = __esm({
|
|
|
18847
18868
|
userId,
|
|
18848
18869
|
password
|
|
18849
18870
|
});
|
|
18850
|
-
if (response.type === "
|
|
18871
|
+
if (response.type === "IFRAME_MSG_BACKUP_ENCRYPTED") {
|
|
18851
18872
|
return response.encryptedData;
|
|
18852
18873
|
}
|
|
18853
18874
|
throw new Error("Unexpected response type");
|
|
@@ -18861,7 +18882,7 @@ var init_iframe_manager = __esm({
|
|
|
18861
18882
|
fileContent,
|
|
18862
18883
|
password
|
|
18863
18884
|
});
|
|
18864
|
-
if (response.type === "
|
|
18885
|
+
if (response.type === "IFRAME_MSG_FILE_RESTORED") {
|
|
18865
18886
|
return response.result;
|
|
18866
18887
|
}
|
|
18867
18888
|
throw new Error("Unexpected response type");
|
|
@@ -18873,7 +18894,7 @@ var init_iframe_manager = __esm({
|
|
|
18873
18894
|
const response = await this.sendMessage("GET_BACKUP_STATUS", {
|
|
18874
18895
|
userId
|
|
18875
18896
|
});
|
|
18876
|
-
if (response.type === "
|
|
18897
|
+
if (response.type === "IFRAME_MSG_BACKUP_STATUS") {
|
|
18877
18898
|
return response.status;
|
|
18878
18899
|
}
|
|
18879
18900
|
throw new Error("Unexpected response type");
|
|
@@ -18883,7 +18904,7 @@ var init_iframe_manager = __esm({
|
|
|
18883
18904
|
*/
|
|
18884
18905
|
async getCloudProviders() {
|
|
18885
18906
|
const response = await this.sendMessage("GET_CLOUD_PROVIDERS", {});
|
|
18886
|
-
if (response.type === "
|
|
18907
|
+
if (response.type === "IFRAME_MSG_CLOUD_PROVIDERS") {
|
|
18887
18908
|
return response.providers;
|
|
18888
18909
|
}
|
|
18889
18910
|
throw new Error("Unexpected response type");
|