@getpara/core-sdk 3.0.0-alpha.1 → 3.1.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/cjs/ParaCore.js +436 -86
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/cryptography/utils.js +5 -2
- package/dist/cjs/errors.js +10 -0
- package/dist/cjs/external/userManagementClient.js +21 -4
- package/dist/cjs/index.js +67 -1
- package/dist/cjs/services/AuthService.js +66 -47
- package/dist/cjs/services/LoginFlowService.js +30 -27
- package/dist/cjs/services/PollingService.js +100 -75
- package/dist/cjs/services/PortalUrlService.js +112 -19
- package/dist/cjs/services/PregenWalletService.js +125 -76
- package/dist/cjs/services/SessionManagementService.js +81 -10
- package/dist/cjs/services/SignupFlowService.js +52 -47
- package/dist/cjs/services/VerificationFlowService.js +13 -10
- package/dist/cjs/services/WalletService.js +51 -36
- package/dist/cjs/shares/enclave.js +44 -24
- package/dist/cjs/state/CoreStateManager.js +17 -5
- package/dist/cjs/state/actors/setupPara.js +4 -1
- package/dist/cjs/state/machines/walletStateMachine.js +22 -0
- package/dist/cjs/telemetry/BeaconSpanProcessor.js +99 -0
- package/dist/cjs/telemetry/config.js +15 -0
- package/dist/cjs/telemetry/init.js +193 -0
- package/dist/cjs/telemetry/modalSession.js +54 -0
- package/dist/cjs/telemetry/session.js +39 -0
- package/dist/cjs/telemetry/tracer.js +126 -0
- package/dist/cjs/telemetry/uxAction.js +30 -0
- package/dist/cjs/telemetry/uxBaggagePropagator.js +58 -0
- package/dist/cjs/telemetry/uxState.js +46 -0
- package/dist/cjs/telemetry/uxStateSpanProcessor.js +51 -0
- package/dist/cjs/utils/configEncoding.js +98 -0
- package/dist/cjs/utils/deprecation.js +13 -13
- package/dist/cjs/utils/index.js +11 -0
- package/dist/cjs/utils/partnerConfig.js +103 -0
- package/dist/cjs/utils/partnerConfigGating.js +83 -0
- package/dist/cjs/utils/stateErrorHelpers.js +6 -1
- package/dist/cjs/utils/url.js +10 -2
- package/dist/esm/ParaCore.js +441 -88
- package/dist/esm/constants.js +1 -1
- package/dist/esm/cryptography/utils.js +5 -2
- package/dist/esm/errors.js +9 -0
- package/dist/esm/external/userManagementClient.js +21 -4
- package/dist/esm/index.js +58 -4
- package/dist/esm/services/AuthService.js +66 -47
- package/dist/esm/services/LoginFlowService.js +30 -27
- package/dist/esm/services/PollingService.js +100 -75
- package/dist/esm/services/PortalUrlService.js +112 -19
- package/dist/esm/services/PregenWalletService.js +125 -76
- package/dist/esm/services/SessionManagementService.js +69 -11
- package/dist/esm/services/SignupFlowService.js +52 -47
- package/dist/esm/services/VerificationFlowService.js +13 -10
- package/dist/esm/services/WalletService.js +51 -36
- package/dist/esm/shares/enclave.js +44 -24
- package/dist/esm/state/CoreStateManager.js +17 -5
- package/dist/esm/state/actors/setupPara.js +4 -1
- package/dist/esm/state/machines/walletStateMachine.js +22 -0
- package/dist/esm/telemetry/BeaconSpanProcessor.js +74 -0
- package/dist/esm/telemetry/config.js +0 -0
- package/dist/esm/telemetry/init.js +130 -0
- package/dist/esm/telemetry/modalSession.js +29 -0
- package/dist/esm/telemetry/session.js +16 -0
- package/dist/esm/telemetry/tracer.js +84 -0
- package/dist/esm/telemetry/uxAction.js +8 -0
- package/dist/esm/telemetry/uxBaggagePropagator.js +35 -0
- package/dist/esm/telemetry/uxState.js +21 -0
- package/dist/esm/telemetry/uxStateSpanProcessor.js +28 -0
- package/dist/esm/utils/configEncoding.js +45 -0
- package/dist/esm/utils/deprecation.js +11 -12
- package/dist/esm/utils/index.js +6 -0
- package/dist/esm/utils/partnerConfig.js +67 -0
- package/dist/esm/utils/partnerConfigGating.js +61 -0
- package/dist/esm/utils/stateErrorHelpers.js +6 -1
- package/dist/esm/utils/url.js +10 -2
- package/dist/types/ParaCore.d.ts +101 -19
- package/dist/types/PlatformUtils.d.ts +1 -0
- package/dist/types/errors.d.ts +26 -0
- package/dist/types/external/userManagementClient.d.ts +2 -1
- package/dist/types/index.d.ts +15 -3
- package/dist/types/services/types/AuthServiceTypes.d.ts +10 -3
- package/dist/types/services/types/PortalUrlServiceTypes.d.ts +3 -3
- package/dist/types/services/types/WalletServiceTypes.d.ts +4 -0
- package/dist/types/state/actors/setupPara.d.ts +18 -0
- package/dist/types/state/machines/authStateMachine.d.ts +1 -1
- package/dist/types/state/machines/coreStateMachine.d.ts +30 -6
- package/dist/types/state/machines/walletStateMachine.d.ts +4 -0
- package/dist/types/state/types/core.d.ts +7 -1
- package/dist/types/telemetry/BeaconSpanProcessor.d.ts +10 -0
- package/dist/types/telemetry/config.d.ts +4 -0
- package/dist/types/telemetry/init.d.ts +17 -0
- package/dist/types/telemetry/modalSession.d.ts +5 -0
- package/dist/types/telemetry/session.d.ts +2 -0
- package/dist/types/telemetry/tracer.d.ts +10 -0
- package/dist/types/telemetry/uxAction.d.ts +3 -0
- package/dist/types/telemetry/uxBaggagePropagator.d.ts +7 -0
- package/dist/types/telemetry/uxState.d.ts +8 -0
- package/dist/types/telemetry/uxStateSpanProcessor.d.ts +9 -0
- package/dist/types/types/config.d.ts +15 -3
- package/dist/types/types/coreApi.d.ts +7 -9
- package/dist/types/types/serviceInterfaces.d.ts +5 -3
- package/dist/types/types/util.d.ts +2 -15
- package/dist/types/utils/configEncoding.d.ts +51 -0
- package/dist/types/utils/deprecation.d.ts +3 -1
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/partnerConfig.d.ts +28 -0
- package/dist/types/utils/partnerConfigGating.d.ts +48 -0
- package/dist/types/utils/url.d.ts +3 -2
- package/package.json +15 -4
package/dist/types/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ParaCore } from './ParaCore.js';
|
|
2
|
-
export { type Auth, type AuthInfo, type PrimaryAuthInfo, type VerifiedAuthInfo, type VerifiedAuth, AuthMethod, type TAuthMethod, AuthMethodStatus, type AuthExtras, type CurrentWalletIds, EmailTheme, type PartnerEntity, type WalletEntity, Network, type TNetwork, WalletType, type TWalletType, WalletScheme, type TWalletScheme, OnRampAsset, type TOnRampAsset, OnRampPurchaseType, OnRampProvider, OnRampPurchaseStatus, type OnRampConfig, type OnRampAssets, type OnRampPurchase, type OnRampAssetInfo, type ProviderAssetInfo, OnRampMethod,
|
|
2
|
+
export { type Auth, type AuthInfo, type PrimaryAuthInfo, type VerifiedAuthInfo, type VerifiedAuth, AuthMethod, type TAuthMethod, AuthMethodStatus, AuthLayout, type TAuthLayout, type AuthExtras, type CurrentWalletIds, EmailTheme, type PartnerEntity, type PartnerAppConfig, type WalletEntity, Network, type TNetwork, WalletType, type TWalletType, WalletScheme, type TWalletScheme, OnRampAsset, type TOnRampAsset, OnRampPurchaseType, OnRampProvider, OnRampPurchaseStatus, type OnRampConfig, type OnRampAssets, type OnRampPurchase, type OnRampAssetInfo, type ProviderAssetInfo, OnRampMethod, OAuthMethod, type TOAuthMethod, type TLinkedAccountType, type SupportedAccountLinks, type SupportedWalletTypes, type TPregenIdentifierType, type PregenIds, type LinkedAccount, type LinkedAccounts, type TExternalWallet, type ExternalWalletInfo, type PregenAuth, type Setup2faResponse, type TelegramAuthResponse, type VerifyExternalWalletParams, type AssetMetadata, type AssetMetadataIndexed, type AssetValue, type BalancesConfig, type WalletBalance, type ProfileBalance, type OfframpDepositRequest, type WalletWithMetadata, RecoveryStatus, ThemeMode, NON_ED25519, PREGEN_IDENTIFIER_TYPES, WALLET_TYPES, WALLET_SCHEMES, OAUTH_METHODS, LINKED_ACCOUNT_TYPES, EXTERNAL_WALLET_TYPES, EVM_WALLETS, SOLANA_WALLETS, COSMOS_WALLETS, formatAssetQuantity, formatCurrency, type EstimateTransactionOpts, type EstimateTransactionResult, type BroadcastTransactionOpts, type BroadcastTransactionResult, type PendingTransactionEntity, type SerializedDecodedTx, type SerializedTxData, type GetPendingTransactionResponse, DeliveryChannel, type PartnerThemeConfig as Theme, } from '@getpara/user-management-client';
|
|
3
3
|
export { PopupType, PregenIdentifierType, type AuthStateSignup, type AuthStateVerify, type AuthStateLogin, type AuthState, type OAuthResponse, type CoreAuthInfo, type SignatureRes, type FullSignatureRes, type SuccessfulSignatureRes, type DeniedSignatureRes, type DeniedSignatureResWithUrl, type Wallet, type AvailableWallet, type AccountLinkInProgress, AccountLinkError, type InternalInterface, type Verify2faParams, type Verify2faResponse, type StorageType, type TelegramParams, type CreateParaSignerBaseOptions, } from './types/index.js';
|
|
4
4
|
export * from './types/smartAccounts.js';
|
|
5
5
|
export * from './types/coreApi.js';
|
|
6
6
|
export * from './types/events.js';
|
|
7
7
|
export * from './types/config.js';
|
|
8
|
-
export { getPortalDomain, dispatchEvent, onParaEvent, offParaEvent, entityToWallet, constructUrl, shortenUrl, isPortal, } from './utils/index.js';
|
|
8
|
+
export { getPortalDomain, dispatchEvent, onParaEvent, offParaEvent, entityToWallet, constructUrl, shortenUrl, isPortal, warnOnce, } from './utils/index.js';
|
|
9
9
|
export { PREFIX as STORAGE_PREFIX, PARA_PREFIX as PARA_STORAGE_PREFIX, LOCAL_STORAGE_CURRENT_WALLET_IDS, LOCAL_STORAGE_WALLETS, } from './constants.js';
|
|
10
10
|
export { distributeNewShare } from './shares/shareDistribution.js';
|
|
11
11
|
export { KeyContainer } from './shares/KeyContainer.js';
|
|
@@ -22,10 +22,22 @@ export * from './utils/phone.js';
|
|
|
22
22
|
export * from './utils/config.js';
|
|
23
23
|
export { isWalletSupported } from './utils/wallet.js';
|
|
24
24
|
export { getNetworkPrefix, getOnRampAssets, getOnRampNetworks, toAssetInfoArray } from './utils/onRamps.js';
|
|
25
|
-
export { getPortalBaseURL } from './utils/url.js';
|
|
25
|
+
export { getPortalBaseURL, getParaConnectBaseUrl } from './utils/url.js';
|
|
26
|
+
export { encodeConfigParams, tryDecodeConfig, isCompressionStreamSupported, ENCODED_CONFIG_VERSION, } from './utils/configEncoding.js';
|
|
27
|
+
export type { EncodedConfig, EncodedAppConfig } from './utils/configEncoding.js';
|
|
26
28
|
export { retrieve as transmissionUtilsRetrieve } from './transmission/transmissionUtils.js';
|
|
27
29
|
export type { ShareData } from './shares/enclave.js';
|
|
28
30
|
export type { StateSnapshot, AuthStateInfo } from './state/types/core';
|
|
29
31
|
export type * from './services/types';
|
|
32
|
+
export { getTracer, wrapWithSpan, wrapWithSpanInContext, extractTraceContextFromUrl, getUrlTraceCarrier, setDefaultParentContext, getDefaultParentContext, SpanStatusCode, } from './telemetry/tracer.js';
|
|
33
|
+
export type { Span, Attributes, Context } from './telemetry/tracer.js';
|
|
34
|
+
export { getOrCreateSessionId } from './telemetry/session.js';
|
|
35
|
+
export { initTelemetry, isTelemetryInitialized, onTelemetryReady, flushTelemetry } from './telemetry/init.js';
|
|
36
|
+
export { getUxState, setCurrentView, setLastInteraction } from './telemetry/uxState.js';
|
|
37
|
+
export { setCurrentUserId } from './telemetry/uxStateSpanProcessor.js';
|
|
38
|
+
export { recordActionOnSpan, type UxActionOutcome } from './telemetry/uxAction.js';
|
|
39
|
+
export { startModalSession, endModalSession, getModalSessionContext } from './telemetry/modalSession.js';
|
|
40
|
+
export type { InitTelemetryOpts } from './telemetry/init.js';
|
|
41
|
+
export type { PartnerTelemetryConfig } from './telemetry/config.js';
|
|
30
42
|
export declare const paraVersion: string;
|
|
31
43
|
export default ParaCore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Auth, AuthExtras, AuthMethod, AuthType, ExternalWalletInfo, PrimaryAuth, PrimaryAuthInfo, ServerAuthState, ServerAuthStateLogin, TAuthMethod,
|
|
1
|
+
import type { Auth, AuthExtras, AuthMethod, AuthType, DeliveryChannel, ExternalWalletInfo, PrimaryAuth, PrimaryAuthInfo, ServerAuthState, ServerAuthStateLogin, TAuthMethod, PartnerThemeConfig, TOAuthMethod } from '@getpara/user-management-client';
|
|
2
2
|
import type { AuthState, AuthStateDone, AuthStateLogin, AuthStateSignup, AuthStateVerify, CoreAuthInfo, WithCustomTheme, WithSessionLookupId, WithShorten, WithUseShortUrls } from '../../types/index.js';
|
|
3
3
|
import type { InitOAuthPollingParams, PollingCallbacks } from './PollingServiceTypes.js';
|
|
4
4
|
import { PerformConnectExternalWalletResponse, ExternalSignMessageParams } from './ExternalWalletServiceTypes.js';
|
|
@@ -36,7 +36,7 @@ export type PrepareAuthStateMethod = <T extends ServerAuthState>(serverAuthState
|
|
|
36
36
|
}) => Promise<AuthState>;
|
|
37
37
|
export type PrepareLoginStateMethod = (loginState: ServerAuthStateLogin, options: {
|
|
38
38
|
useShortUrls?: boolean;
|
|
39
|
-
portalTheme?:
|
|
39
|
+
portalTheme?: PartnerThemeConfig;
|
|
40
40
|
sessionLookupId: string;
|
|
41
41
|
}) => Promise<AuthStateLogin>;
|
|
42
42
|
export interface AuthenticateWithEmailOrPhoneParams extends SignUpOrLogInParams {
|
|
@@ -145,6 +145,13 @@ export type AddCredentialMethod = (_: AddCredentialParams) => Promise<string | u
|
|
|
145
145
|
export type SupportedUserAuthMethodsMethod = () => Promise<Set<AuthMethod>>;
|
|
146
146
|
export interface ResendVerificationCodeParams {
|
|
147
147
|
type?: 'SIGNUP' | 'LINK_ACCOUNT' | 'LOGIN';
|
|
148
|
+
deliveryChannel?: DeliveryChannel;
|
|
148
149
|
}
|
|
149
|
-
export
|
|
150
|
+
export interface ResendVerificationCodeResponse {
|
|
151
|
+
deliveryChannel?: DeliveryChannel;
|
|
152
|
+
fallbackUsed?: boolean;
|
|
153
|
+
fallbackChannel?: DeliveryChannel;
|
|
154
|
+
isSmsAllowed?: boolean;
|
|
155
|
+
}
|
|
156
|
+
export type ResendVerificationCodeMethod = (_: ResendVerificationCodeParams) => Promise<ResendVerificationCodeResponse>;
|
|
150
157
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TAuthMethod, TOAuthMethod } from '@getpara/user-management-client';
|
|
2
|
-
import type { AccountLinkInProgress,
|
|
1
|
+
import type { TAuthMethod, TOAuthMethod, PartnerThemeConfig } from '@getpara/user-management-client';
|
|
2
|
+
import type { AccountLinkInProgress, WithAuthMethod, WithCustomTheme, WithSessionId, WithShorten } from '../../types/index.js';
|
|
3
3
|
type Device = {
|
|
4
4
|
sessionId: string;
|
|
5
5
|
encryptionKey: string;
|
|
@@ -11,7 +11,7 @@ export type PortalUrlOptions = {
|
|
|
11
11
|
thisDevice?: Device;
|
|
12
12
|
newDevice?: Device;
|
|
13
13
|
sessionId?: string;
|
|
14
|
-
portalTheme?:
|
|
14
|
+
portalTheme?: PartnerThemeConfig;
|
|
15
15
|
pathId?: string;
|
|
16
16
|
shorten?: boolean;
|
|
17
17
|
isEmbedded?: boolean;
|
|
@@ -111,6 +111,10 @@ export interface RequestFaucetParams {
|
|
|
111
111
|
chain?: string;
|
|
112
112
|
}
|
|
113
113
|
export interface RequestFaucetResponse {
|
|
114
|
+
/**
|
|
115
|
+
* Hash for the submitted faucet funding transaction. Wait for confirmation
|
|
116
|
+
* before assuming funds are spendable.
|
|
117
|
+
*/
|
|
114
118
|
transactionHash: string;
|
|
115
119
|
amount: string;
|
|
116
120
|
chain: string;
|
|
@@ -1,2 +1,20 @@
|
|
|
1
1
|
import { StateMachineInterface } from '../../types/serviceInterfaces.js';
|
|
2
|
+
/**
|
|
3
|
+
* Bootstraps the SDK. Runs the platform-specific `setup()` (Farcaster init,
|
|
4
|
+
* wallet-record backfill, etc.) AND an eager partner-record load via
|
|
5
|
+
* `touchSession` in parallel — both are independent network/IO tasks and
|
|
6
|
+
* the state machine only flips `isReady=true` once this actor resolves.
|
|
7
|
+
*
|
|
8
|
+
* Eager partner load lives here rather than inside each subclass's setup()
|
|
9
|
+
* so every consumer of core-sdk (ParaWeb, ParaServer, future subclasses)
|
|
10
|
+
* gets it for free — the state machine is the canonical SDK lifecycle,
|
|
11
|
+
* and "partner is loaded" is part of being ready.
|
|
12
|
+
*
|
|
13
|
+
* Skipped in the portal context where `ModalLayoutV2` runs its own
|
|
14
|
+
* getPartner fetch with separate telemetry plumbing — calling touchSession
|
|
15
|
+
* there would duplicate the call. Best-effort otherwise: a network failure
|
|
16
|
+
* keeps partner unloaded for now, partner-dependent code paths fall back
|
|
17
|
+
* to legacy props / lazy-load via `#assertPartner` at gated method
|
|
18
|
+
* call-sites, and the SDK still becomes ready.
|
|
19
|
+
*/
|
|
2
20
|
export declare const createSetupParaActor: (paraCoreInterface: StateMachineInterface) => import("xstate").PromiseActorLogic<void, {}, import("xstate").EventObject>;
|
|
@@ -842,7 +842,7 @@ export declare function createAuthStateMachine(paraCoreInterface: StateMachineIn
|
|
|
842
842
|
data: {
|
|
843
843
|
authState: ServerAuthState;
|
|
844
844
|
sessionLookupId: string;
|
|
845
|
-
portalTheme: import("
|
|
845
|
+
portalTheme: import("@getpara/user-management-client").PartnerThemeConfig;
|
|
846
846
|
useShortUrls: boolean;
|
|
847
847
|
};
|
|
848
848
|
finished: boolean;
|
|
@@ -842,7 +842,7 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
842
842
|
data: {
|
|
843
843
|
authState: import("@getpara/shared").ServerAuthState;
|
|
844
844
|
sessionLookupId: string;
|
|
845
|
-
portalTheme: import("
|
|
845
|
+
portalTheme: import("@getpara/shared/dist/types/types/partnerAppConfig.js").PartnerThemeConfig;
|
|
846
846
|
useShortUrls: boolean;
|
|
847
847
|
};
|
|
848
848
|
finished: boolean;
|
|
@@ -2889,6 +2889,10 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
2889
2889
|
}];
|
|
2890
2890
|
};
|
|
2891
2891
|
readonly needs_wallets: {
|
|
2892
|
+
readonly always: readonly [{
|
|
2893
|
+
readonly target: "creating_wallets";
|
|
2894
|
+
readonly guard: "shouldAutoCreate";
|
|
2895
|
+
}];
|
|
2892
2896
|
readonly on: {
|
|
2893
2897
|
readonly WAIT_FOR_WALLET_CREATION: {
|
|
2894
2898
|
readonly target: "claiming_wallets";
|
|
@@ -4584,7 +4588,7 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
4584
4588
|
data: {
|
|
4585
4589
|
authState: import("@getpara/shared").ServerAuthState;
|
|
4586
4590
|
sessionLookupId: string;
|
|
4587
|
-
portalTheme: import("
|
|
4591
|
+
portalTheme: import("@getpara/shared/dist/types/types/partnerAppConfig.js").PartnerThemeConfig;
|
|
4588
4592
|
useShortUrls: boolean;
|
|
4589
4593
|
};
|
|
4590
4594
|
finished: boolean;
|
|
@@ -6636,6 +6640,10 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
6636
6640
|
}];
|
|
6637
6641
|
};
|
|
6638
6642
|
readonly needs_wallets: {
|
|
6643
|
+
readonly always: readonly [{
|
|
6644
|
+
readonly target: "creating_wallets";
|
|
6645
|
+
readonly guard: "shouldAutoCreate";
|
|
6646
|
+
}];
|
|
6639
6647
|
readonly on: {
|
|
6640
6648
|
readonly WAIT_FOR_WALLET_CREATION: {
|
|
6641
6649
|
readonly target: "claiming_wallets";
|
|
@@ -8404,7 +8412,7 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
8404
8412
|
data: {
|
|
8405
8413
|
authState: import("@getpara/shared").ServerAuthState;
|
|
8406
8414
|
sessionLookupId: string;
|
|
8407
|
-
portalTheme: import("
|
|
8415
|
+
portalTheme: import("@getpara/shared/dist/types/types/partnerAppConfig.js").PartnerThemeConfig;
|
|
8408
8416
|
useShortUrls: boolean;
|
|
8409
8417
|
};
|
|
8410
8418
|
finished: boolean;
|
|
@@ -10456,6 +10464,10 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
10456
10464
|
}];
|
|
10457
10465
|
};
|
|
10458
10466
|
readonly needs_wallets: {
|
|
10467
|
+
readonly always: readonly [{
|
|
10468
|
+
readonly target: "creating_wallets";
|
|
10469
|
+
readonly guard: "shouldAutoCreate";
|
|
10470
|
+
}];
|
|
10459
10471
|
readonly on: {
|
|
10460
10472
|
readonly WAIT_FOR_WALLET_CREATION: {
|
|
10461
10473
|
readonly target: "claiming_wallets";
|
|
@@ -12162,7 +12174,7 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
12162
12174
|
data: {
|
|
12163
12175
|
authState: import("@getpara/shared").ServerAuthState;
|
|
12164
12176
|
sessionLookupId: string;
|
|
12165
|
-
portalTheme: import("
|
|
12177
|
+
portalTheme: import("@getpara/shared/dist/types/types/partnerAppConfig.js").PartnerThemeConfig;
|
|
12166
12178
|
useShortUrls: boolean;
|
|
12167
12179
|
};
|
|
12168
12180
|
finished: boolean;
|
|
@@ -14214,6 +14226,10 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
14214
14226
|
}];
|
|
14215
14227
|
};
|
|
14216
14228
|
readonly needs_wallets: {
|
|
14229
|
+
readonly always: readonly [{
|
|
14230
|
+
readonly target: "creating_wallets";
|
|
14231
|
+
readonly guard: "shouldAutoCreate";
|
|
14232
|
+
}];
|
|
14217
14233
|
readonly on: {
|
|
14218
14234
|
readonly WAIT_FOR_WALLET_CREATION: {
|
|
14219
14235
|
readonly target: "claiming_wallets";
|
|
@@ -16014,7 +16030,7 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
16014
16030
|
data: {
|
|
16015
16031
|
authState: import("@getpara/shared").ServerAuthState;
|
|
16016
16032
|
sessionLookupId: string;
|
|
16017
|
-
portalTheme: import("
|
|
16033
|
+
portalTheme: import("@getpara/shared/dist/types/types/partnerAppConfig.js").PartnerThemeConfig;
|
|
16018
16034
|
useShortUrls: boolean;
|
|
16019
16035
|
};
|
|
16020
16036
|
finished: boolean;
|
|
@@ -18066,6 +18082,10 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
18066
18082
|
}];
|
|
18067
18083
|
};
|
|
18068
18084
|
readonly needs_wallets: {
|
|
18085
|
+
readonly always: readonly [{
|
|
18086
|
+
readonly target: "creating_wallets";
|
|
18087
|
+
readonly guard: "shouldAutoCreate";
|
|
18088
|
+
}];
|
|
18069
18089
|
readonly on: {
|
|
18070
18090
|
readonly WAIT_FOR_WALLET_CREATION: {
|
|
18071
18091
|
readonly target: "claiming_wallets";
|
|
@@ -19773,7 +19793,7 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
19773
19793
|
data: {
|
|
19774
19794
|
authState: import("@getpara/shared").ServerAuthState;
|
|
19775
19795
|
sessionLookupId: string;
|
|
19776
|
-
portalTheme: import("
|
|
19796
|
+
portalTheme: import("@getpara/shared/dist/types/types/partnerAppConfig.js").PartnerThemeConfig;
|
|
19777
19797
|
useShortUrls: boolean;
|
|
19778
19798
|
};
|
|
19779
19799
|
finished: boolean;
|
|
@@ -21825,6 +21845,10 @@ export declare function createCoreStateMachine(paraCoreInterface: StateMachineIn
|
|
|
21825
21845
|
}];
|
|
21826
21846
|
};
|
|
21827
21847
|
readonly needs_wallets: {
|
|
21848
|
+
readonly always: readonly [{
|
|
21849
|
+
readonly target: "creating_wallets";
|
|
21850
|
+
readonly guard: "shouldAutoCreate";
|
|
21851
|
+
}];
|
|
21828
21852
|
readonly on: {
|
|
21829
21853
|
readonly WAIT_FOR_WALLET_CREATION: {
|
|
21830
21854
|
readonly target: "claiming_wallets";
|
|
@@ -211,6 +211,10 @@ export declare function createWalletStateMachine(paraCoreInterface: StateMachine
|
|
|
211
211
|
}];
|
|
212
212
|
};
|
|
213
213
|
readonly needs_wallets: {
|
|
214
|
+
readonly always: readonly [{
|
|
215
|
+
readonly target: "creating_wallets";
|
|
216
|
+
readonly guard: "shouldAutoCreate";
|
|
217
|
+
}];
|
|
214
218
|
readonly on: {
|
|
215
219
|
readonly WAIT_FOR_WALLET_CREATION: {
|
|
216
220
|
readonly target: "claiming_wallets";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BiometricLocationHint, CurrentWalletIds, ServerAuthState, TOAuthMethod } from '@getpara/user-management-client';
|
|
1
|
+
import type { BiometricLocationHint, CurrentWalletIds, DeliveryChannel, ServerAuthState, TOAuthMethod } from '@getpara/user-management-client';
|
|
2
2
|
import type { AuthState, Wallet, WithCustomTheme, WithUseShortUrls } from '../../types/index.js';
|
|
3
3
|
import { AuthMachine, AuthPhase } from './auth.js';
|
|
4
4
|
import { WalletMachine, WalletPhase } from './wallet.js';
|
|
@@ -96,6 +96,12 @@ export type AuthStateInfo = {
|
|
|
96
96
|
verificationUrl: string | null;
|
|
97
97
|
/** Full (unshortened) verification URL. Used by preloaded iframe. */
|
|
98
98
|
verificationFullUrl: string | null;
|
|
99
|
+
/** Channel the OTP was sent over — set on phone verifications so the UI can render channel-specific copy */
|
|
100
|
+
deliveryChannel: DeliveryChannel | null;
|
|
101
|
+
/** True when the server had to fall back from the primary channel (WhatsApp → SMS typically) */
|
|
102
|
+
fallbackUsed: boolean;
|
|
103
|
+
/** The channel actually used when fallbackUsed is true */
|
|
104
|
+
fallbackChannel: DeliveryChannel | null;
|
|
99
105
|
/** External wallet verification data when signature is needed */
|
|
100
106
|
externalWalletVerification: {
|
|
101
107
|
signatureVerificationMessage: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReadableSpan, Span, SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
2
|
+
import type { Context } from '@opentelemetry/api';
|
|
3
|
+
export declare class BeaconSpanProcessor implements SpanProcessor {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(url: string);
|
|
6
|
+
onStart(_span: Span, _parentContext: Context): void;
|
|
7
|
+
onEnd(span: ReadableSpan): void;
|
|
8
|
+
forceFlush(): Promise<void>;
|
|
9
|
+
shutdown(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Attributes } from '@opentelemetry/api';
|
|
2
|
+
import type { SDKType } from '@getpara/user-management-client';
|
|
3
|
+
export type InitTelemetryOpts = {
|
|
4
|
+
tunnelUrl: string;
|
|
5
|
+
sampleRate: number;
|
|
6
|
+
sdkType: SDKType;
|
|
7
|
+
sdkVersion: string;
|
|
8
|
+
partnerId?: string;
|
|
9
|
+
resourceAttributes?: Attributes;
|
|
10
|
+
isDev?: boolean;
|
|
11
|
+
isPortal?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare function onTelemetryReady(cb: () => void): void;
|
|
14
|
+
export declare function initTelemetry(opts: InitTelemetryOpts): Promise<void>;
|
|
15
|
+
export declare function isTelemetryInitialized(): boolean;
|
|
16
|
+
export declare function flushTelemetry(): Promise<void>;
|
|
17
|
+
export declare function __resetTelemetryForTests(): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Context } from '@opentelemetry/api';
|
|
2
|
+
export declare function startModalSession(): void;
|
|
3
|
+
export declare function endModalSession(): void;
|
|
4
|
+
export declare function getModalSessionContext(): Context | undefined;
|
|
5
|
+
export declare function __resetModalSessionForTests(): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Attributes, type Context, type Span } from '@opentelemetry/api';
|
|
2
|
+
export declare function getTracer(): import("@opentelemetry/api").Tracer;
|
|
3
|
+
export declare function setDefaultParentContext(ctx: Context): void;
|
|
4
|
+
export declare function getDefaultParentContext(): Context | undefined;
|
|
5
|
+
export declare function wrapWithSpan<T>(name: string, fn: (span: Span) => Promise<T> | T, attributes?: Attributes): Promise<T>;
|
|
6
|
+
export declare function extractTraceContextFromUrl(search?: string): Context;
|
|
7
|
+
export declare function getUrlTraceCarrier(search?: string): Record<string, string>;
|
|
8
|
+
export declare function wrapWithSpanInContext<T>(parentContext: Context, name: string, fn: (span: Span, traceHeaders: Record<string, string>) => Promise<T> | T): Promise<T>;
|
|
9
|
+
export { SpanStatusCode } from '@opentelemetry/api';
|
|
10
|
+
export type { Span, Attributes, Context } from '@opentelemetry/api';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Context, type TextMapGetter, type TextMapPropagator, type TextMapSetter } from '@opentelemetry/api';
|
|
2
|
+
export declare class UxBaggagePropagator implements TextMapPropagator {
|
|
3
|
+
#private;
|
|
4
|
+
inject(ctx: Context, carrier: unknown, setter: TextMapSetter): void;
|
|
5
|
+
extract(ctx: Context, carrier: unknown, getter: TextMapGetter): Context;
|
|
6
|
+
fields(): string[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type UxState = {
|
|
2
|
+
view?: string;
|
|
3
|
+
lastInteraction?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function getUxState(): Readonly<UxState>;
|
|
6
|
+
export declare function setCurrentView(view: string | undefined): void;
|
|
7
|
+
export declare function setLastInteraction(targetId: string | undefined): void;
|
|
8
|
+
export declare function __resetUxStateForTests(): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Context } from '@opentelemetry/api';
|
|
2
|
+
import type { Span, SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
export declare function setCurrentUserId(userId: string | undefined): void;
|
|
4
|
+
export declare class UxStateSpanProcessor implements SpanProcessor {
|
|
5
|
+
onStart(span: Span, _parentContext: Context): void;
|
|
6
|
+
onEnd(): void;
|
|
7
|
+
forceFlush(): Promise<void>;
|
|
8
|
+
shutdown(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import Client, { EmailTheme, Network, OnRampAsset, OnRampProvider, PregenAuth, TWalletScheme, TWalletType } from '@getpara/user-management-client';
|
|
2
|
+
import Client, { EmailTheme, Network, OnRampAsset, OnRampProvider, PregenAuth, SdkOverridableAppConfig, TWalletScheme, TWalletType, PartnerThemeConfig } from '@getpara/user-management-client';
|
|
3
3
|
import { EnclaveClient } from '../shares/enclave.js';
|
|
4
|
-
import type { PortalTheme } from './util.js';
|
|
5
4
|
export declare enum Environment {
|
|
6
5
|
DEV = "DEV",
|
|
7
6
|
SANDBOX = "SANDBOX",
|
|
@@ -95,7 +94,7 @@ export interface ConstructorOpts {
|
|
|
95
94
|
* Theme to use for the portal
|
|
96
95
|
* @deprecated configure theming through the developer portal
|
|
97
96
|
*/
|
|
98
|
-
portalTheme?:
|
|
97
|
+
portalTheme?: PartnerThemeConfig;
|
|
99
98
|
useDKLSForCreation?: boolean;
|
|
100
99
|
disableWebSockets?: boolean;
|
|
101
100
|
wasmOverride?: ArrayBuffer;
|
|
@@ -157,4 +156,17 @@ export interface ConstructorOpts {
|
|
|
157
156
|
* @default false
|
|
158
157
|
*/
|
|
159
158
|
enableDebugLogs?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* SDK-side overrides for partner-driven app config. Applied as the
|
|
161
|
+
* `#constructorOverrides` layer in `paraCore.config`'s merge chain. The React
|
|
162
|
+
* provider's `configOverrides` prop sits on top via a separate layer; React
|
|
163
|
+
* always wins when both surfaces touch the same key.
|
|
164
|
+
*
|
|
165
|
+
* Most partners should configure these in the developer portal — the constructor
|
|
166
|
+
* surface exists primarily for non-React contexts (`@getpara/server-sdk`,
|
|
167
|
+
* custom integrations) and dev-time iteration.
|
|
168
|
+
*
|
|
169
|
+
* The overridable subset is `SdkOverridableAppConfig`, enforced at compile time.
|
|
170
|
+
*/
|
|
171
|
+
configOverrides?: Partial<SdkOverridableAppConfig>;
|
|
160
172
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ExternalWalletInfo, OnRampPurchase, OnRampPurchaseCreateParams, Setup2faResponse, VerifiedAuth, WalletEntity, WalletParams, TWalletType, IssueJwtParams, IssueJwtResponse, TLinkedAccountType, LinkedAccounts, AuthMethod } from '@getpara/user-management-client';
|
|
1
|
+
import { ExternalWalletInfo, OnRampPurchase, OnRampPurchaseCreateParams, Setup2faResponse, VerifiedAuth, WalletEntity, WalletParams, TWalletType, IssueJwtParams, IssueJwtResponse, TLinkedAccountType, LinkedAccounts, AuthMethod, DeliveryChannel } from '@getpara/user-management-client';
|
|
2
2
|
import type { OAuthResponse, WithCustomTheme, WithUseShortUrls, Verify2faParams, Verify2faResponse, AuthStateSignup, StorageType, CoreAuthInfo, TelegramParams } from './';
|
|
3
3
|
import { ParaCore } from '../ParaCore.js';
|
|
4
4
|
import { FullSignatureRes, Wallet } from './wallet.js';
|
|
5
5
|
import { AccountLinkInProgress } from './accountLinking.js';
|
|
6
|
-
import type { WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, WaitForWalletCreationResponse, GetOAuthUrlParams, AddCredentialParams, LoginExternalWalletParams, LoginExternalWalletResponse, ResendVerificationCodeParams, SignUpOrLogInParams, SignUpOrLogInResponse, VerifyOAuthProcessParams, VerifyExternalWalletParams, VerifyExternalWalletResponse, VerifyFarcasterParams, VerifyTelegramParams, ClaimPregenWalletsParams, ClaimPregenWalletsResponse, CreateGuestWalletsResponse, CreatePregenWalletParams, CreatePregenWalletPerTypeParams, CreatePregenWalletPerTypeResponse, CreatePregenWalletResponse, CreateWalletParams, CreateWalletPerTypeParams, CreateWalletPerTypeResponse, CreateWalletResponse, DistributeNewWalletShareParams, GetPregenWalletsParams, GetPregenWalletsResponse, GetWalletBalanceParams, HasPregenWalletParams, PollingCallbacks, RefreshShareParams, RefreshShareResponse, RequestFaucetParams, RequestFaucetResponse, UpdatePregenWalletIdentifierParams, BaseVerifyExternalWalletParams, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse } from '../services/types';
|
|
6
|
+
import type { WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, WaitForWalletCreationResponse, GetOAuthUrlParams, AddCredentialParams, LoginExternalWalletParams, LoginExternalWalletResponse, ResendVerificationCodeParams, ResendVerificationCodeResponse, SignUpOrLogInParams, SignUpOrLogInResponse, VerifyOAuthProcessParams, VerifyExternalWalletParams, VerifyExternalWalletResponse, VerifyFarcasterParams, VerifyTelegramParams, ClaimPregenWalletsParams, ClaimPregenWalletsResponse, CreateGuestWalletsResponse, CreatePregenWalletParams, CreatePregenWalletPerTypeParams, CreatePregenWalletPerTypeResponse, CreatePregenWalletResponse, CreateWalletParams, CreateWalletPerTypeParams, CreateWalletPerTypeResponse, CreateWalletResponse, DistributeNewWalletShareParams, GetPregenWalletsParams, GetPregenWalletsResponse, GetWalletBalanceParams, HasPregenWalletParams, PollingCallbacks, RefreshShareParams, RefreshShareResponse, RequestFaucetParams, RequestFaucetResponse, UpdatePregenWalletIdentifierParams, BaseVerifyExternalWalletParams, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse } from '../services/types';
|
|
7
7
|
export declare const PARA_CORE_METHODS: readonly ["getAuthInfo", "signUpOrLogIn", "verifyNewAccount", "waitForLogin", "waitForSignup", "waitForWalletCreation", "getOAuthUrl", "verifyOAuth", "getFarcasterConnectUri", "verifyFarcaster", "verifyTelegram", "resendVerificationCode", "loginExternalWallet", "verifyExternalWallet", "setup2fa", "enable2fa", "verify2fa", "logout", "clearStorage", "isSessionActive", "isFullyLoggedIn", "refreshSession", "keepSessionAlive", "exportSession", "waitAndExportSession", "importSession", "getVerificationToken", "getWallets", "getWalletsByType", "fetchWallets", "createWallet", "createWalletPerType", "getPregenWallets", "hasPregenWallet", "updatePregenWalletIdentifier", "createPregenWallet", "createPregenWalletPerType", "claimPregenWallets", "createGuestWallets", "distributeNewWalletShare", "getUserShare", "setUserShare", "refreshShare", "signMessage", "signTransaction", "initiateOnRampTransaction", "getWalletBalance", "requestFaucet", "issueJwt", "getLinkedAccounts", "accountLinkInProgress", "addCredential", "exportPrivateKey", "authenticateWithEmailOrPhone", "authenticateWithOAuth"];
|
|
8
8
|
export declare const PARA_INTERNAL_METHODS: readonly ["linkAccount", "unlinkAccount", "verifyEmailOrPhoneLink", "verifyOAuthLink", "verifyFarcasterLink", "verifyTelegramLink", "verifyExternalWalletLink", "accountLinkInProgress", "prepareLogin", "sendLoginCode", "supportedUserAuthMethods"];
|
|
9
9
|
export type CoreMethodName = (typeof PARA_CORE_METHODS)[number];
|
|
@@ -189,7 +189,7 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
189
189
|
};
|
|
190
190
|
resendVerificationCode: {
|
|
191
191
|
params: ResendVerificationCodeParams;
|
|
192
|
-
response:
|
|
192
|
+
response: ResendVerificationCodeResponse;
|
|
193
193
|
};
|
|
194
194
|
logout: {
|
|
195
195
|
params: LogoutParams;
|
|
@@ -278,32 +278,26 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
278
278
|
params: CreateWalletPerTypeParams;
|
|
279
279
|
response: CreateWalletPerTypeResponse;
|
|
280
280
|
};
|
|
281
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
282
281
|
getPregenWallets: {
|
|
283
282
|
params: GetPregenWalletsParams;
|
|
284
283
|
response: GetPregenWalletsResponse;
|
|
285
284
|
};
|
|
286
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
287
285
|
updatePregenWalletIdentifier: {
|
|
288
286
|
params: UpdatePregenWalletIdentifierParams;
|
|
289
287
|
response: void;
|
|
290
288
|
};
|
|
291
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
292
289
|
hasPregenWallet: {
|
|
293
290
|
params: HasPregenWalletParams;
|
|
294
291
|
response: boolean;
|
|
295
292
|
};
|
|
296
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
297
293
|
createPregenWallet: {
|
|
298
294
|
params: CreatePregenWalletParams;
|
|
299
295
|
response: CreatePregenWalletResponse;
|
|
300
296
|
};
|
|
301
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
302
297
|
createPregenWalletPerType: {
|
|
303
298
|
params: CreatePregenWalletPerTypeParams;
|
|
304
299
|
response: CreatePregenWalletPerTypeResponse;
|
|
305
300
|
};
|
|
306
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
307
301
|
claimPregenWallets: {
|
|
308
302
|
params: ClaimPregenWalletsParams;
|
|
309
303
|
response: ClaimPregenWalletsResponse;
|
|
@@ -429,6 +423,10 @@ export type InternalMethods = {
|
|
|
429
423
|
params: void;
|
|
430
424
|
response: {
|
|
431
425
|
userId: string;
|
|
426
|
+
deliveryChannel?: DeliveryChannel;
|
|
427
|
+
fallbackUsed?: boolean;
|
|
428
|
+
fallbackChannel?: DeliveryChannel;
|
|
429
|
+
isSmsAllowed?: boolean;
|
|
432
430
|
};
|
|
433
431
|
};
|
|
434
432
|
supportedUserAuthMethods: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { pki as pkiType } from 'node-forge';
|
|
2
|
-
import type { PartnerEntity, BackupKitEmailProps, VerificationEmailProps, TLinkedAccountType } from '@getpara/user-management-client';
|
|
3
|
-
import type { Ctx, Environment, AccountLinkInProgress, ConstructorOpts
|
|
2
|
+
import type { PartnerAppConfig, PartnerEntity, BackupKitEmailProps, VerificationEmailProps, TLinkedAccountType, PartnerThemeConfig } from '@getpara/user-management-client';
|
|
3
|
+
import type { Ctx, Environment, AccountLinkInProgress, ConstructorOpts } from './index.js';
|
|
4
4
|
import type { PlatformUtils } from '../PlatformUtils.js';
|
|
5
5
|
import type { AuthService } from '../services/AuthService.js';
|
|
6
6
|
import type { WalletService } from '../services/WalletService.js';
|
|
@@ -71,13 +71,15 @@ export interface PortalUrlServiceInterface {
|
|
|
71
71
|
isPartnerOptional: boolean | undefined;
|
|
72
72
|
ctx: Ctx;
|
|
73
73
|
get loginEncryptionKeyPair(): pkiType.rsa.KeyPair | undefined;
|
|
74
|
-
portalTheme?:
|
|
74
|
+
portalTheme?: PartnerThemeConfig;
|
|
75
75
|
portalPrimaryButtonColor?: string;
|
|
76
76
|
portalTextColor?: string;
|
|
77
77
|
portalPrimaryButtonTextColor?: string;
|
|
78
78
|
portalBackgroundColor?: string;
|
|
79
79
|
borderRadius?: string;
|
|
80
80
|
get accountLinkInProgress(): AccountLinkInProgress | undefined;
|
|
81
|
+
/** Merged partner-config surface (partner ⊕ SDK overrides); `{}` before the partner record loads. */
|
|
82
|
+
get config(): PartnerAppConfig;
|
|
81
83
|
}
|
|
82
84
|
export interface SessionManagementServiceInterface {
|
|
83
85
|
displayModalError: (error?: string) => void;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import { TAuthMethod,
|
|
2
|
-
/**
|
|
3
|
-
* Extended portal theme type that adds new theming fields not yet in the
|
|
4
|
-
* backend `Theme` type from `@getpara/user-management-client`.
|
|
5
|
-
*
|
|
6
|
-
* TODO: Remove this extension once the UMC `Theme` type includes
|
|
7
|
-
* `foregroundMixRatio` and `cssOverrides`.
|
|
8
|
-
*/
|
|
9
|
-
export type PortalTheme = Theme & {
|
|
10
|
-
/** Controls how much the foreground/accent color is mixed into generated UI palette steps. */
|
|
11
|
-
foregroundMixRatio?: number;
|
|
12
|
-
/** Raw CSS variable overrides applied after theme generation. Advanced use. */
|
|
13
|
-
cssOverrides?: Record<string, string>;
|
|
14
|
-
};
|
|
1
|
+
import { TAuthMethod, PartnerThemeConfig } from '@getpara/user-management-client';
|
|
15
2
|
export type WithAuthMethod = {
|
|
16
3
|
/**
|
|
17
4
|
* Which authorization method to use for the URL, either `'PASSKEY'`, `'PASSWORD'` or `'PIN'`.
|
|
@@ -22,7 +9,7 @@ export type WithCustomTheme = {
|
|
|
22
9
|
/**
|
|
23
10
|
* The theme to apply to generated URLs, if different from your configured theme.
|
|
24
11
|
*/
|
|
25
|
-
portalTheme?:
|
|
12
|
+
portalTheme?: PartnerThemeConfig;
|
|
26
13
|
};
|
|
27
14
|
export type WithUseShortUrls = {
|
|
28
15
|
/**
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { PartnerThemeConfig } from '@getpara/user-management-client';
|
|
2
|
+
/**
|
|
3
|
+
* Versioned envelope carried by the optional `c` URL search param when the
|
|
4
|
+
* plain-form portal URL would exceed the tier-1 length threshold. Mirrors the
|
|
5
|
+
* top-level shape of the partner config blob (theme + app slices); the auth
|
|
6
|
+
* slice was intentionally omitted since the portal renders no
|
|
7
|
+
* auth-method-selection UI and the params had no consumer.
|
|
8
|
+
*
|
|
9
|
+
* `v` is required and acts as the compat key. The portal validates it on
|
|
10
|
+
* decode and silently falls back to individual URL params on unknown versions
|
|
11
|
+
* — so future schema evolution (e.g. adding an auth slice if portal-side
|
|
12
|
+
* gating ever ships) is BW-compat: older portals just ignore the blob.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ENCODED_CONFIG_VERSION: 1;
|
|
15
|
+
export type EncodedAppConfig = {
|
|
16
|
+
appName?: string;
|
|
17
|
+
homepageUrl?: string;
|
|
18
|
+
};
|
|
19
|
+
export type EncodedConfig = {
|
|
20
|
+
v: typeof ENCODED_CONFIG_VERSION;
|
|
21
|
+
theme?: PartnerThemeConfig;
|
|
22
|
+
app?: EncodedAppConfig;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Feature detection — `CompressionStream` lands in Chrome 80 (2020), Firefox 113
|
|
26
|
+
* (May 2023), and Safari 16.4 (March 2023). The current portal browserslist
|
|
27
|
+
* resolves a minimum of iOS Safari 15.6 + Safari 15.6, which DON'T have it.
|
|
28
|
+
*
|
|
29
|
+
* On unsupported browsers, the SDK skips tier 2 emission and lets the portal
|
|
30
|
+
* URL fall through to tier 3 (`shortenUrl`) at the cost of ~150ms RTT. Adding
|
|
31
|
+
* a sync pako fallback (~45 KB on the cold path) is an option if iOS 15.x
|
|
32
|
+
* latency on long-URL flows becomes a real complaint — the seam lives here.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isCompressionStreamSupported(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Encode the config blob as `base64url(gzip(JSON))`. Async because both
|
|
37
|
+
* `CompressionStream` (encode side) and `DecompressionStream` (decode side)
|
|
38
|
+
* are Streams API and produce async output.
|
|
39
|
+
*
|
|
40
|
+
* Returns `null` when `CompressionStream` is unavailable so callers can
|
|
41
|
+
* gracefully degrade to tier 3 instead of throwing.
|
|
42
|
+
*/
|
|
43
|
+
export declare function encodeConfigParams(config: EncodedConfig): Promise<string | null>;
|
|
44
|
+
/**
|
|
45
|
+
* Inverse of `encodeConfigParams`. Never throws — returns `null` on any
|
|
46
|
+
* failure (corrupt base64, invalid gzip, invalid JSON, unknown `v`, etc.)
|
|
47
|
+
* so the portal can silently fall back to individual URL params.
|
|
48
|
+
*
|
|
49
|
+
* Async because `DecompressionStream` is part of the Streams API.
|
|
50
|
+
*/
|
|
51
|
+
export declare function tryDecodeConfig(s: string): Promise<EncodedConfig | null>;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function warnOnce(scope: string, key: string, message: string): void;
|
|
2
|
+
/** Test-only: clear the warned set so tests can assert "warns once" across cases. */
|
|
3
|
+
export declare function _resetWarnOnceForTests(): void;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from './autobind.js';
|
|
2
2
|
export * from './config.js';
|
|
3
|
+
export { warnOnce } from './deprecation.js';
|
|
3
4
|
export * from './events.js';
|
|
4
5
|
export * from './formatting.js';
|
|
5
6
|
export * from './json.js';
|
|
6
7
|
export * from './listeners.js';
|
|
7
8
|
export * from './onRamps.js';
|
|
9
|
+
export * from './partnerConfig.js';
|
|
8
10
|
export * from './phone.js';
|
|
9
11
|
export * from './polling.js';
|
|
10
12
|
export * from './types.js';
|