@scalemule/nextjs 0.0.38 → 0.0.40
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/client.d.mts +5 -1
- package/dist/client.d.ts +5 -1
- package/dist/{index-BoENfro3.d.mts → index-BIIUrnPr.d.mts} +54 -1
- package/dist/{index-BoENfro3.d.ts → index-BIIUrnPr.d.ts} +54 -1
- package/dist/index.d.mts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +175 -72
- package/dist/index.mjs +167 -73
- package/dist/server/auth.js +275 -6
- package/dist/server/auth.mjs +275 -6
- package/dist/server/index.d.mts +135 -4
- package/dist/server/index.d.ts +135 -4
- package/dist/server/index.js +333 -6
- package/dist/server/index.mjs +325 -7
- package/dist/server/webhook-handler.d.mts +3 -2
- package/dist/server/webhook-handler.d.ts +3 -2
- package/dist/server/webhook-handler.js +3 -0
- package/dist/server/webhook-handler.mjs +3 -0
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{webhook-handler-CjSSCdvI.d.ts → webhook-handler-BjFbqZuq.d.ts} +4 -1
- package/dist/{webhook-handler-Cz9jtet2.d.mts → webhook-handler-BqzCYRNJ.d.mts} +4 -1
- package/package.json +3 -2
package/dist/client.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a8 as StorageAdapter } from './index-BIIUrnPr.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ScaleMule API Client
|
|
@@ -34,6 +34,10 @@ interface ClientConfig {
|
|
|
34
34
|
* preventing race conditions where requests fire before the auth token is available.
|
|
35
35
|
*/
|
|
36
36
|
pendingSessionInit?: boolean;
|
|
37
|
+
/** Enable the account switcher */
|
|
38
|
+
enableAccountSwitcher?: boolean;
|
|
39
|
+
/** Privacy level for account switcher */
|
|
40
|
+
accountSwitcherPrivacy?: 'full' | 'masked' | 'minimal';
|
|
37
41
|
}
|
|
38
42
|
interface RequestOptions extends RequestInit {
|
|
39
43
|
/** Skip adding auth headers (for public endpoints) */
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a8 as StorageAdapter } from './index-BIIUrnPr.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ScaleMule API Client
|
|
@@ -34,6 +34,10 @@ interface ClientConfig {
|
|
|
34
34
|
* preventing race conditions where requests fire before the auth token is available.
|
|
35
35
|
*/
|
|
36
36
|
pendingSessionInit?: boolean;
|
|
37
|
+
/** Enable the account switcher */
|
|
38
|
+
enableAccountSwitcher?: boolean;
|
|
39
|
+
/** Privacy level for account switcher */
|
|
40
|
+
accountSwitcherPrivacy?: 'full' | 'masked' | 'minimal';
|
|
37
41
|
}
|
|
38
42
|
interface RequestOptions extends RequestInit {
|
|
39
43
|
/** Skip adding auth headers (for public endpoints) */
|
|
@@ -66,6 +66,29 @@ interface ScaleMuleConfig {
|
|
|
66
66
|
* publishableKey: 'sm_pb_production_a1b2c3d4...'
|
|
67
67
|
*/
|
|
68
68
|
publishableKey?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Enable the account switcher — remembers which accounts have logged in on
|
|
71
|
+
* this device so users can pick an account and re-authenticate.
|
|
72
|
+
*
|
|
73
|
+
* Stores only display metadata (email, name, avatar) — no tokens.
|
|
74
|
+
* Switching accounts always requires re-authentication.
|
|
75
|
+
*
|
|
76
|
+
* When using auth proxy mode, this works via a non-httpOnly cookie.
|
|
77
|
+
* The server route config must also have `enableAccountSwitcher: true`.
|
|
78
|
+
*
|
|
79
|
+
* Default: false
|
|
80
|
+
*/
|
|
81
|
+
enableAccountSwitcher?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Privacy level for account switcher display metadata.
|
|
84
|
+
*
|
|
85
|
+
* - 'full': Store email, name, avatar as-is (default)
|
|
86
|
+
* - 'masked': Mask email (j***@g***.com), truncate name to initial
|
|
87
|
+
* - 'minimal': No PII at all — just a colored "Account" label
|
|
88
|
+
*
|
|
89
|
+
* Applies to both server-side cookie writes and client-side reads.
|
|
90
|
+
*/
|
|
91
|
+
accountSwitcherPrivacy?: 'full' | 'masked' | 'minimal';
|
|
69
92
|
}
|
|
70
93
|
interface StorageAdapter {
|
|
71
94
|
getItem(key: string): string | null | Promise<string | null>;
|
|
@@ -444,6 +467,36 @@ interface UseAuthReturn {
|
|
|
444
467
|
verifyPhone: (request: PhoneVerifyRequest) => Promise<void>;
|
|
445
468
|
/** Login with phone number */
|
|
446
469
|
loginWithPhone: (request: PhoneLoginRequest) => Promise<LoginResponse>;
|
|
470
|
+
/**
|
|
471
|
+
* All accounts that have previously logged in on this device.
|
|
472
|
+
* Contains display metadata only — no tokens.
|
|
473
|
+
* Requires `enableAccountSwitcher: true` in config.
|
|
474
|
+
*/
|
|
475
|
+
knownAccounts: KnownAccountInfo[];
|
|
476
|
+
/**
|
|
477
|
+
* Switch to a different known account.
|
|
478
|
+
* Logs out the current session and returns the target account's info
|
|
479
|
+
* so the login form can be pre-filled. User must re-authenticate.
|
|
480
|
+
*/
|
|
481
|
+
switchAccount: (userId: string) => Promise<KnownAccountInfo | null>;
|
|
482
|
+
/** Remove a specific account from the known accounts list */
|
|
483
|
+
removeKnownAccount: (userId: string) => Promise<void>;
|
|
484
|
+
/** Clear all known accounts from this device */
|
|
485
|
+
clearKnownAccounts: () => Promise<void>;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Known account info — display metadata only, no tokens.
|
|
489
|
+
* Used by the account switcher to show previously logged-in accounts.
|
|
490
|
+
*/
|
|
491
|
+
interface KnownAccountInfo {
|
|
492
|
+
userId: string;
|
|
493
|
+
email?: string;
|
|
494
|
+
fullName?: string;
|
|
495
|
+
avatarUrl?: string;
|
|
496
|
+
provider?: string;
|
|
497
|
+
lastActiveAt: string;
|
|
498
|
+
displayLabel?: string;
|
|
499
|
+
colorIndex?: number;
|
|
447
500
|
}
|
|
448
501
|
interface UseContentReturn {
|
|
449
502
|
/** User's files */
|
|
@@ -842,4 +895,4 @@ interface UseBillingReturn {
|
|
|
842
895
|
}) => Promise<string | null>;
|
|
843
896
|
}
|
|
844
897
|
|
|
845
|
-
export { type
|
|
898
|
+
export { type RegisterRequest as $, type ApiError as A, type BatchTrackRequest as B, type ChangeEmailRequest as C, type DeviceFingerprint as D, type EnhancedAnalyticsEvent as E, type ForgotPasswordRequest as F, type MFASetupRequest as G, type MFAStatus as H, type MFATOTPSetupResponse as I, type MFAVerifyRequest as J, type KnownAccountInfo as K, type LoginResponse as L, type MFAChallengeResponse as M, type OAuthCallbackResponse as N, type OAuthCallbackRequest as O, type OAuthConfig as P, type OAuthProvider as Q, type OAuthStartResponse as R, type ScaleMuleConfig as S, type PageViewData as T, type User as U, type PayoutSchedule as V, type PhoneLoginRequest as W, type PhoneSendCodeRequest as X, type PhoneVerifyRequest as Y, type Profile as Z, type RefreshResponse as _, type UseAuthReturn as a, type ResetPasswordRequest as a0, ScaleMuleApiError as a1, type ScaleMuleEnvironment as a2, type Session as a3, type SignedUploadCompleteRequest as a4, type SignedUploadRequest as a5, type SignedUploadResponse as a6, type SignedUploadUrl as a7, type StorageAdapter as a8, type StorageFile as a9, type TrackEventResponse as aa, type TransactionSummary as ab, type UTMParams as ac, type UpdateProfileRequest as ad, type UploadOptions as ae, type UploadResponse as af, type VerifyEmailRequest as ag, type UseBillingReturn as b, type ListFilesParams as c, type UseContentReturn as d, type UseUserReturn as e, type UseAnalyticsOptions as f, type UseAnalyticsReturn as g, type AccountBalance as h, type AnalyticsEvent as i, type ApiResponse as j, type BillingPayment as k, type BillingPayout as l, type BillingRefund as m, type BillingTransaction as n, type ChangePasswordRequest as o, type ClientContext as p, type ConnectedAccount as q, type DeviceInfo as r, type LinkedAccount as s, type ListFilesResponse as t, type LoginDeviceInfo as u, type LoginRequest as v, type LoginResponseWithMFA as w, type LoginRiskInfo as x, type MFAMethod as y, type MFASMSSetupResponse as z };
|
|
@@ -66,6 +66,29 @@ interface ScaleMuleConfig {
|
|
|
66
66
|
* publishableKey: 'sm_pb_production_a1b2c3d4...'
|
|
67
67
|
*/
|
|
68
68
|
publishableKey?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Enable the account switcher — remembers which accounts have logged in on
|
|
71
|
+
* this device so users can pick an account and re-authenticate.
|
|
72
|
+
*
|
|
73
|
+
* Stores only display metadata (email, name, avatar) — no tokens.
|
|
74
|
+
* Switching accounts always requires re-authentication.
|
|
75
|
+
*
|
|
76
|
+
* When using auth proxy mode, this works via a non-httpOnly cookie.
|
|
77
|
+
* The server route config must also have `enableAccountSwitcher: true`.
|
|
78
|
+
*
|
|
79
|
+
* Default: false
|
|
80
|
+
*/
|
|
81
|
+
enableAccountSwitcher?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Privacy level for account switcher display metadata.
|
|
84
|
+
*
|
|
85
|
+
* - 'full': Store email, name, avatar as-is (default)
|
|
86
|
+
* - 'masked': Mask email (j***@g***.com), truncate name to initial
|
|
87
|
+
* - 'minimal': No PII at all — just a colored "Account" label
|
|
88
|
+
*
|
|
89
|
+
* Applies to both server-side cookie writes and client-side reads.
|
|
90
|
+
*/
|
|
91
|
+
accountSwitcherPrivacy?: 'full' | 'masked' | 'minimal';
|
|
69
92
|
}
|
|
70
93
|
interface StorageAdapter {
|
|
71
94
|
getItem(key: string): string | null | Promise<string | null>;
|
|
@@ -444,6 +467,36 @@ interface UseAuthReturn {
|
|
|
444
467
|
verifyPhone: (request: PhoneVerifyRequest) => Promise<void>;
|
|
445
468
|
/** Login with phone number */
|
|
446
469
|
loginWithPhone: (request: PhoneLoginRequest) => Promise<LoginResponse>;
|
|
470
|
+
/**
|
|
471
|
+
* All accounts that have previously logged in on this device.
|
|
472
|
+
* Contains display metadata only — no tokens.
|
|
473
|
+
* Requires `enableAccountSwitcher: true` in config.
|
|
474
|
+
*/
|
|
475
|
+
knownAccounts: KnownAccountInfo[];
|
|
476
|
+
/**
|
|
477
|
+
* Switch to a different known account.
|
|
478
|
+
* Logs out the current session and returns the target account's info
|
|
479
|
+
* so the login form can be pre-filled. User must re-authenticate.
|
|
480
|
+
*/
|
|
481
|
+
switchAccount: (userId: string) => Promise<KnownAccountInfo | null>;
|
|
482
|
+
/** Remove a specific account from the known accounts list */
|
|
483
|
+
removeKnownAccount: (userId: string) => Promise<void>;
|
|
484
|
+
/** Clear all known accounts from this device */
|
|
485
|
+
clearKnownAccounts: () => Promise<void>;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Known account info — display metadata only, no tokens.
|
|
489
|
+
* Used by the account switcher to show previously logged-in accounts.
|
|
490
|
+
*/
|
|
491
|
+
interface KnownAccountInfo {
|
|
492
|
+
userId: string;
|
|
493
|
+
email?: string;
|
|
494
|
+
fullName?: string;
|
|
495
|
+
avatarUrl?: string;
|
|
496
|
+
provider?: string;
|
|
497
|
+
lastActiveAt: string;
|
|
498
|
+
displayLabel?: string;
|
|
499
|
+
colorIndex?: number;
|
|
447
500
|
}
|
|
448
501
|
interface UseContentReturn {
|
|
449
502
|
/** User's files */
|
|
@@ -842,4 +895,4 @@ interface UseBillingReturn {
|
|
|
842
895
|
}) => Promise<string | null>;
|
|
843
896
|
}
|
|
844
897
|
|
|
845
|
-
export { type
|
|
898
|
+
export { type RegisterRequest as $, type ApiError as A, type BatchTrackRequest as B, type ChangeEmailRequest as C, type DeviceFingerprint as D, type EnhancedAnalyticsEvent as E, type ForgotPasswordRequest as F, type MFASetupRequest as G, type MFAStatus as H, type MFATOTPSetupResponse as I, type MFAVerifyRequest as J, type KnownAccountInfo as K, type LoginResponse as L, type MFAChallengeResponse as M, type OAuthCallbackResponse as N, type OAuthCallbackRequest as O, type OAuthConfig as P, type OAuthProvider as Q, type OAuthStartResponse as R, type ScaleMuleConfig as S, type PageViewData as T, type User as U, type PayoutSchedule as V, type PhoneLoginRequest as W, type PhoneSendCodeRequest as X, type PhoneVerifyRequest as Y, type Profile as Z, type RefreshResponse as _, type UseAuthReturn as a, type ResetPasswordRequest as a0, ScaleMuleApiError as a1, type ScaleMuleEnvironment as a2, type Session as a3, type SignedUploadCompleteRequest as a4, type SignedUploadRequest as a5, type SignedUploadResponse as a6, type SignedUploadUrl as a7, type StorageAdapter as a8, type StorageFile as a9, type TrackEventResponse as aa, type TransactionSummary as ab, type UTMParams as ac, type UpdateProfileRequest as ad, type UploadOptions as ae, type UploadResponse as af, type VerifyEmailRequest as ag, type UseBillingReturn as b, type ListFilesParams as c, type UseContentReturn as d, type UseUserReturn as e, type UseAnalyticsOptions as f, type UseAnalyticsReturn as g, type AccountBalance as h, type AnalyticsEvent as i, type ApiResponse as j, type BillingPayment as k, type BillingPayout as l, type BillingRefund as m, type BillingTransaction as n, type ChangePasswordRequest as o, type ClientContext as p, type ConnectedAccount as q, type DeviceInfo as r, type LinkedAccount as s, type ListFilesResponse as t, type LoginDeviceInfo as u, type LoginRequest as v, type LoginResponseWithMFA as w, type LoginRiskInfo as x, type MFAMethod as y, type MFASMSSetupResponse as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { MoneyClient } from '@scalemule/money';
|
|
4
|
+
export { MoneyClient, MoneyClientConfig, createMoneyClient } from '@scalemule/money';
|
|
3
5
|
import { RealtimeService } from '@scalemule/sdk';
|
|
4
6
|
import { ScaleMuleClient } from './client.mjs';
|
|
5
7
|
export { ClientConfig, RequestOptions, createClient } from './client.mjs';
|
|
6
|
-
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-
|
|
7
|
-
export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, B as BatchTrackRequest, k as BillingPayment, l as BillingPayout, m as BillingRefund, n as BillingTransaction, C as ChangeEmailRequest, o as ChangePasswordRequest, p as ClientContext, q as ConnectedAccount, D as DeviceFingerprint, r as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, s as LinkedAccount, t as ListFilesResponse, u as LoginDeviceInfo, v as LoginRequest, w as LoginResponseWithMFA, x as LoginRiskInfo, M as MFAChallengeResponse, y as MFAMethod, z as MFASMSSetupResponse, G as MFASetupRequest, H as MFAStatus, I as MFATOTPSetupResponse, J as MFAVerifyRequest, O as OAuthCallbackRequest,
|
|
8
|
+
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-BIIUrnPr.mjs';
|
|
9
|
+
export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, B as BatchTrackRequest, k as BillingPayment, l as BillingPayout, m as BillingRefund, n as BillingTransaction, C as ChangeEmailRequest, o as ChangePasswordRequest, p as ClientContext, q as ConnectedAccount, D as DeviceFingerprint, r as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, s as LinkedAccount, t as ListFilesResponse, u as LoginDeviceInfo, v as LoginRequest, w as LoginResponseWithMFA, x as LoginRiskInfo, M as MFAChallengeResponse, y as MFAMethod, z as MFASMSSetupResponse, G as MFASetupRequest, H as MFAStatus, I as MFATOTPSetupResponse, J as MFAVerifyRequest, O as OAuthCallbackRequest, N as OAuthCallbackResponse, P as OAuthConfig, Q as OAuthProvider, R as OAuthStartResponse, T as PageViewData, V as PayoutSchedule, W as PhoneLoginRequest, X as PhoneSendCodeRequest, Y as PhoneVerifyRequest, Z as Profile, _ as RefreshResponse, $ as RegisterRequest, a0 as ResetPasswordRequest, a1 as ScaleMuleApiError, a2 as ScaleMuleEnvironment, a3 as Session, a4 as SignedUploadCompleteRequest, a5 as SignedUploadRequest, a6 as SignedUploadResponse, a7 as SignedUploadUrl, a8 as StorageAdapter, a9 as StorageFile, aa as TrackEventResponse, ab as TransactionSummary, ac as UTMParams, ad as UpdateProfileRequest, ae as UploadOptions, af as UploadResponse, ag as VerifyEmailRequest } from './index-BIIUrnPr.mjs';
|
|
8
10
|
|
|
9
11
|
interface ScaleMuleContextValue {
|
|
10
12
|
/** The API client instance */
|
|
11
13
|
client: ScaleMuleClient;
|
|
14
|
+
/** Money client instance sharing the same session token */
|
|
15
|
+
money: MoneyClient;
|
|
12
16
|
/** Base SDK realtime service — shared singleton for WebSocket connections */
|
|
13
17
|
realtime: RealtimeService;
|
|
14
18
|
/** Current authenticated user */
|
|
@@ -31,6 +35,10 @@ interface ScaleMuleContextValue {
|
|
|
31
35
|
gatewayUrl?: string;
|
|
32
36
|
/** Configured environment ('dev' or 'prod') */
|
|
33
37
|
environment?: string;
|
|
38
|
+
/** Whether the account switcher is enabled */
|
|
39
|
+
enableAccountSwitcher?: boolean;
|
|
40
|
+
/** Privacy level for account switcher */
|
|
41
|
+
accountSwitcherPrivacy?: string;
|
|
34
42
|
/** Server-evaluated flag values to bootstrap the client (eliminates loading flash) */
|
|
35
43
|
bootstrapFlags?: Record<string, unknown>;
|
|
36
44
|
}
|
|
@@ -45,9 +53,10 @@ interface ScaleMuleProviderProps extends ScaleMuleConfig {
|
|
|
45
53
|
/** Server-evaluated flag values to bootstrap the client (eliminates loading flash) */
|
|
46
54
|
bootstrapFlags?: Record<string, unknown>;
|
|
47
55
|
}
|
|
48
|
-
declare function ScaleMuleProvider({ apiKey, applicationId, environment, gatewayUrl, debug, storage, analyticsProxyUrl, authProxyUrl, publishableKey, children, onLogin, onLogout, onAuthError, bootstrapFlags, }: ScaleMuleProviderProps): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare function ScaleMuleProvider({ apiKey, applicationId, environment, gatewayUrl, debug, storage, analyticsProxyUrl, authProxyUrl, publishableKey, enableAccountSwitcher, accountSwitcherPrivacy, children, onLogin, onLogout, onAuthError, bootstrapFlags, }: ScaleMuleProviderProps): react_jsx_runtime.JSX.Element;
|
|
49
57
|
declare function useScaleMule(): ScaleMuleContextValue;
|
|
50
58
|
declare function useScaleMuleClient(): ScaleMuleClient;
|
|
59
|
+
declare function useMoneyClient(): MoneyClient;
|
|
51
60
|
|
|
52
61
|
declare function useAuth(): UseAuthReturn;
|
|
53
62
|
|
|
@@ -131,6 +140,8 @@ interface UseContentOptions {
|
|
|
131
140
|
*/
|
|
132
141
|
declare function useContent(options?: UseContentOptions): UseContentReturn;
|
|
133
142
|
|
|
143
|
+
declare const useMoney: typeof useMoneyClient;
|
|
144
|
+
|
|
134
145
|
/**
|
|
135
146
|
* User profile hook for ScaleMule
|
|
136
147
|
*
|
|
@@ -493,4 +504,4 @@ declare function createSafeLogger(prefix: string): {
|
|
|
493
504
|
error: (message: string, data?: unknown) => void;
|
|
494
505
|
};
|
|
495
506
|
|
|
496
|
-
export { ApiError, type FeatureFlagEvaluation, type FeatureFlagEvaluation as FeatureFlagResult, ListFilesParams, LoginResponse, type PasswordValidationResult, type PhoneCountry, type PhoneValidationResult, type RealtimeEvent, type RealtimeMessage, type RealtimeStatus, ScaleMuleClient, ScaleMuleConfig, ScaleMuleProvider, type ScaleMuleProviderProps, UseAnalyticsOptions, UseAnalyticsReturn, UseAuthReturn, UseBillingReturn, UseContentReturn, type UseFeatureFlagsOptions, type UseFeatureFlagsReturn, type UseFeatureFlagsOptions as UseFlagsOptions, type UseFeatureFlagsReturn as UseFlagsReturn, type UsePushNotificationsOptions, type UsePushNotificationsReturn, type UseRealtimeOptions, type UseRealtimeReturn, type UseShareOptions, type UseShareReturn, UseUserReturn, User, type UsernameValidationResult, composePhone, createSafeLogger, normalizePhone, phoneCountries, sanitizeForLog, useAnalytics, useAuth, useBilling, useContent, useFeatureFlags, usePushNotifications, useRealtime, useScaleMule, useScaleMuleClient, useShare, useUser, validateForm, validators };
|
|
507
|
+
export { ApiError, type FeatureFlagEvaluation, type FeatureFlagEvaluation as FeatureFlagResult, ListFilesParams, LoginResponse, type PasswordValidationResult, type PhoneCountry, type PhoneValidationResult, type RealtimeEvent, type RealtimeMessage, type RealtimeStatus, ScaleMuleClient, ScaleMuleConfig, ScaleMuleProvider, type ScaleMuleProviderProps, UseAnalyticsOptions, UseAnalyticsReturn, UseAuthReturn, UseBillingReturn, UseContentReturn, type UseFeatureFlagsOptions, type UseFeatureFlagsReturn, type UseFeatureFlagsOptions as UseFlagsOptions, type UseFeatureFlagsReturn as UseFlagsReturn, type UsePushNotificationsOptions, type UsePushNotificationsReturn, type UseRealtimeOptions, type UseRealtimeReturn, type UseShareOptions, type UseShareReturn, UseUserReturn, User, type UsernameValidationResult, composePhone, createSafeLogger, normalizePhone, phoneCountries, sanitizeForLog, useAnalytics, useAuth, useBilling, useContent, useFeatureFlags, useMoney, useMoneyClient, usePushNotifications, useRealtime, useScaleMule, useScaleMuleClient, useShare, useUser, validateForm, validators };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { MoneyClient } from '@scalemule/money';
|
|
4
|
+
export { MoneyClient, MoneyClientConfig, createMoneyClient } from '@scalemule/money';
|
|
3
5
|
import { RealtimeService } from '@scalemule/sdk';
|
|
4
6
|
import { ScaleMuleClient } from './client.js';
|
|
5
7
|
export { ClientConfig, RequestOptions, createClient } from './client.js';
|
|
6
|
-
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-
|
|
7
|
-
export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, B as BatchTrackRequest, k as BillingPayment, l as BillingPayout, m as BillingRefund, n as BillingTransaction, C as ChangeEmailRequest, o as ChangePasswordRequest, p as ClientContext, q as ConnectedAccount, D as DeviceFingerprint, r as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, s as LinkedAccount, t as ListFilesResponse, u as LoginDeviceInfo, v as LoginRequest, w as LoginResponseWithMFA, x as LoginRiskInfo, M as MFAChallengeResponse, y as MFAMethod, z as MFASMSSetupResponse, G as MFASetupRequest, H as MFAStatus, I as MFATOTPSetupResponse, J as MFAVerifyRequest, O as OAuthCallbackRequest,
|
|
8
|
+
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-BIIUrnPr.js';
|
|
9
|
+
export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, B as BatchTrackRequest, k as BillingPayment, l as BillingPayout, m as BillingRefund, n as BillingTransaction, C as ChangeEmailRequest, o as ChangePasswordRequest, p as ClientContext, q as ConnectedAccount, D as DeviceFingerprint, r as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, s as LinkedAccount, t as ListFilesResponse, u as LoginDeviceInfo, v as LoginRequest, w as LoginResponseWithMFA, x as LoginRiskInfo, M as MFAChallengeResponse, y as MFAMethod, z as MFASMSSetupResponse, G as MFASetupRequest, H as MFAStatus, I as MFATOTPSetupResponse, J as MFAVerifyRequest, O as OAuthCallbackRequest, N as OAuthCallbackResponse, P as OAuthConfig, Q as OAuthProvider, R as OAuthStartResponse, T as PageViewData, V as PayoutSchedule, W as PhoneLoginRequest, X as PhoneSendCodeRequest, Y as PhoneVerifyRequest, Z as Profile, _ as RefreshResponse, $ as RegisterRequest, a0 as ResetPasswordRequest, a1 as ScaleMuleApiError, a2 as ScaleMuleEnvironment, a3 as Session, a4 as SignedUploadCompleteRequest, a5 as SignedUploadRequest, a6 as SignedUploadResponse, a7 as SignedUploadUrl, a8 as StorageAdapter, a9 as StorageFile, aa as TrackEventResponse, ab as TransactionSummary, ac as UTMParams, ad as UpdateProfileRequest, ae as UploadOptions, af as UploadResponse, ag as VerifyEmailRequest } from './index-BIIUrnPr.js';
|
|
8
10
|
|
|
9
11
|
interface ScaleMuleContextValue {
|
|
10
12
|
/** The API client instance */
|
|
11
13
|
client: ScaleMuleClient;
|
|
14
|
+
/** Money client instance sharing the same session token */
|
|
15
|
+
money: MoneyClient;
|
|
12
16
|
/** Base SDK realtime service — shared singleton for WebSocket connections */
|
|
13
17
|
realtime: RealtimeService;
|
|
14
18
|
/** Current authenticated user */
|
|
@@ -31,6 +35,10 @@ interface ScaleMuleContextValue {
|
|
|
31
35
|
gatewayUrl?: string;
|
|
32
36
|
/** Configured environment ('dev' or 'prod') */
|
|
33
37
|
environment?: string;
|
|
38
|
+
/** Whether the account switcher is enabled */
|
|
39
|
+
enableAccountSwitcher?: boolean;
|
|
40
|
+
/** Privacy level for account switcher */
|
|
41
|
+
accountSwitcherPrivacy?: string;
|
|
34
42
|
/** Server-evaluated flag values to bootstrap the client (eliminates loading flash) */
|
|
35
43
|
bootstrapFlags?: Record<string, unknown>;
|
|
36
44
|
}
|
|
@@ -45,9 +53,10 @@ interface ScaleMuleProviderProps extends ScaleMuleConfig {
|
|
|
45
53
|
/** Server-evaluated flag values to bootstrap the client (eliminates loading flash) */
|
|
46
54
|
bootstrapFlags?: Record<string, unknown>;
|
|
47
55
|
}
|
|
48
|
-
declare function ScaleMuleProvider({ apiKey, applicationId, environment, gatewayUrl, debug, storage, analyticsProxyUrl, authProxyUrl, publishableKey, children, onLogin, onLogout, onAuthError, bootstrapFlags, }: ScaleMuleProviderProps): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare function ScaleMuleProvider({ apiKey, applicationId, environment, gatewayUrl, debug, storage, analyticsProxyUrl, authProxyUrl, publishableKey, enableAccountSwitcher, accountSwitcherPrivacy, children, onLogin, onLogout, onAuthError, bootstrapFlags, }: ScaleMuleProviderProps): react_jsx_runtime.JSX.Element;
|
|
49
57
|
declare function useScaleMule(): ScaleMuleContextValue;
|
|
50
58
|
declare function useScaleMuleClient(): ScaleMuleClient;
|
|
59
|
+
declare function useMoneyClient(): MoneyClient;
|
|
51
60
|
|
|
52
61
|
declare function useAuth(): UseAuthReturn;
|
|
53
62
|
|
|
@@ -131,6 +140,8 @@ interface UseContentOptions {
|
|
|
131
140
|
*/
|
|
132
141
|
declare function useContent(options?: UseContentOptions): UseContentReturn;
|
|
133
142
|
|
|
143
|
+
declare const useMoney: typeof useMoneyClient;
|
|
144
|
+
|
|
134
145
|
/**
|
|
135
146
|
* User profile hook for ScaleMule
|
|
136
147
|
*
|
|
@@ -493,4 +504,4 @@ declare function createSafeLogger(prefix: string): {
|
|
|
493
504
|
error: (message: string, data?: unknown) => void;
|
|
494
505
|
};
|
|
495
506
|
|
|
496
|
-
export { ApiError, type FeatureFlagEvaluation, type FeatureFlagEvaluation as FeatureFlagResult, ListFilesParams, LoginResponse, type PasswordValidationResult, type PhoneCountry, type PhoneValidationResult, type RealtimeEvent, type RealtimeMessage, type RealtimeStatus, ScaleMuleClient, ScaleMuleConfig, ScaleMuleProvider, type ScaleMuleProviderProps, UseAnalyticsOptions, UseAnalyticsReturn, UseAuthReturn, UseBillingReturn, UseContentReturn, type UseFeatureFlagsOptions, type UseFeatureFlagsReturn, type UseFeatureFlagsOptions as UseFlagsOptions, type UseFeatureFlagsReturn as UseFlagsReturn, type UsePushNotificationsOptions, type UsePushNotificationsReturn, type UseRealtimeOptions, type UseRealtimeReturn, type UseShareOptions, type UseShareReturn, UseUserReturn, User, type UsernameValidationResult, composePhone, createSafeLogger, normalizePhone, phoneCountries, sanitizeForLog, useAnalytics, useAuth, useBilling, useContent, useFeatureFlags, usePushNotifications, useRealtime, useScaleMule, useScaleMuleClient, useShare, useUser, validateForm, validators };
|
|
507
|
+
export { ApiError, type FeatureFlagEvaluation, type FeatureFlagEvaluation as FeatureFlagResult, ListFilesParams, LoginResponse, type PasswordValidationResult, type PhoneCountry, type PhoneValidationResult, type RealtimeEvent, type RealtimeMessage, type RealtimeStatus, ScaleMuleClient, ScaleMuleConfig, ScaleMuleProvider, type ScaleMuleProviderProps, UseAnalyticsOptions, UseAnalyticsReturn, UseAuthReturn, UseBillingReturn, UseContentReturn, type UseFeatureFlagsOptions, type UseFeatureFlagsReturn, type UseFeatureFlagsOptions as UseFlagsOptions, type UseFeatureFlagsReturn as UseFlagsReturn, type UsePushNotificationsOptions, type UsePushNotificationsReturn, type UseRealtimeOptions, type UseRealtimeReturn, type UseShareOptions, type UseShareReturn, UseUserReturn, User, type UsernameValidationResult, composePhone, createSafeLogger, normalizePhone, phoneCountries, sanitizeForLog, useAnalytics, useAuth, useBilling, useContent, useFeatureFlags, useMoney, useMoneyClient, usePushNotifications, useRealtime, useScaleMule, useScaleMuleClient, useShare, useUser, validateForm, validators };
|