From 2332517c4d70d0f17994aa1cf6541ac3c3f0f59b Mon Sep 17 00:00:00 2001 From: "Sourav Ganguly (isouravganguly)" Date: Wed, 1 Jul 2026 17:17:56 +0530 Subject: [PATCH] bump Loans SDK to dark-theme internal release (Android 5.1.4-91, iOS 7.1.2-44) --- android/build.gradle | 2 +- .../SmallcaseGatewayModule.kt | 20 +++++-- ios/SmallcaseGateway.m | 28 +++++++-- react-native-smallcase-gateway.podspec | 4 +- .../android/app/build.gradle | 2 +- .../android/app/proguard-rules.pro | 32 +++++++++++ .../android/gradle.properties | 6 +- .../app/screens/LoansScreen.tsx | 57 ++++++++++++++----- smart_investing_react_native/ios/Podfile.lock | 19 ++++--- smart_investing_react_native/yarn.lock | 43 +++++++++++--- src/ScLoan.js | 3 + types/ScLoan.d.ts | 4 ++ 12 files changed, 175 insertions(+), 45 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index c984747f..de3a0b60 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -150,7 +150,7 @@ dependencies { //noinspection GradleDynamicVersion implementation 'com.facebook.react:react-native:+' // From node_modules implementation 'com.smallcase.gateway:sdk:6.1.1' - implementation 'com.smallcase.loans:sdk:5.1.3' + implementation 'com.smallcase.loans:sdk-sourav-native-dark-theme-82ee39c:5.1.4-91-release' implementation "androidx.core:core-ktx:1.3.1" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt b/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt index 392efa48..c36f9a6e 100644 --- a/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt +++ b/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt @@ -352,7 +352,7 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte promise.reject(Throwable("Interaction token is null")) return } - val loanConfigObj = ScLoanInfo(interactionToken) + val loanConfigObj = ScLoanInfo(interactionToken, parseColorScheme(hashMap["colorScheme"])) ScLoan.apply(appCompatActivity, loanConfigObj, object : ScLoanResult { override fun onFailure(error: ScLoanError) { promise.reject("${error.code}", scLoanResponseToWritableMap(error) ?: return) @@ -376,7 +376,7 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte promise.reject(Throwable("Interaction token is null")) return } - val loanConfigObj = ScLoanInfo(interactionToken) + val loanConfigObj = ScLoanInfo(interactionToken, parseColorScheme(hashMap["colorScheme"])) ScLoan.pay(appCompatActivity, loanConfigObj, object : ScLoanResult { override fun onFailure(error: ScLoanError) { promise.reject("${error.code}", scLoanResponseToWritableMap(error) ?: return) @@ -400,7 +400,7 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte promise.reject(Throwable("Interaction token is null")) return } - val loanConfigObj = ScLoanInfo(interactionToken) + val loanConfigObj = ScLoanInfo(interactionToken, parseColorScheme(hashMap["colorScheme"])) ScLoan.withdraw(appCompatActivity, loanConfigObj, object : ScLoanResult { override fun onFailure(error: ScLoanError) { promise.reject("${error.code}", scLoanResponseToWritableMap(error) ?: return) @@ -424,7 +424,7 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte promise.reject(Throwable("Interaction token is null")) return } - val loanConfigObj = ScLoanInfo(interactionToken) + val loanConfigObj = ScLoanInfo(interactionToken, parseColorScheme(hashMap["colorScheme"])) ScLoan.service(appCompatActivity, loanConfigObj, object : ScLoanResult { override fun onFailure(error: ScLoanError) { promise.reject("${error.code}", scLoanResponseToWritableMap(error) ?: return) @@ -448,7 +448,7 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte promise.reject(Throwable("Interaction token is null")) return } - val loanConfigObj = ScLoanInfo(interactionToken) + val loanConfigObj = ScLoanInfo(interactionToken, parseColorScheme(hashMap["colorScheme"])) ScLoan.triggerInteraction(appCompatActivity, loanConfigObj, object : ScLoanResult { override fun onFailure(error: ScLoanError) { promise.reject("${error.code}", scLoanResponseToWritableMap(error) ?: return) @@ -460,6 +460,16 @@ class SmallcaseGatewayModule(reactContext: ReactApplicationContext) : ReactConte }) } + // colorScheme rides the bridge as a primitive string (not a serialized object) and is + // mapped back to the native enum here. Unknown/absent → null, so the SDK keeps its + // "partner sent nothing → light, don't force theme param" default. + private fun parseColorScheme(value: String?): ScLoanColorScheme? = when (value) { + "dark" -> ScLoanColorScheme.DARK + "light" -> ScLoanColorScheme.LIGHT + "system" -> ScLoanColorScheme.SYSTEM + else -> null + } + private fun getProtocol(envName: String): Environment.PROTOCOL { return when (envName) { "production" -> Environment.PROTOCOL.PRODUCTION diff --git a/ios/SmallcaseGateway.m b/ios/SmallcaseGateway.m index c86e79d8..fa04027c 100644 --- a/ios/SmallcaseGateway.m +++ b/ios/SmallcaseGateway.m @@ -628,6 +628,24 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject) }); } +// colorScheme rides the bridge as a primitive string (not a serialized object) and is +// mapped back to the native enum here. Unknown/absent → the token-only initializer, so the +// SDK keeps its "partner sent nothing → light, don't force theme param" default. +- (ScLoanInfo *)loanInfoFromDict:(NSDictionary *)loanInfo { + NSString *interactionToken = loanInfo[@"interactionToken"]; + id scheme = loanInfo[@"colorScheme"]; + if ([scheme isKindOfClass:[NSString class]]) { + if ([scheme isEqualToString:@"dark"]) { + return [[ScLoanInfo alloc] initWithInteractionToken:interactionToken colorScheme:ScLoanColorSchemeDark]; + } else if ([scheme isEqualToString:@"light"]) { + return [[ScLoanInfo alloc] initWithInteractionToken:interactionToken colorScheme:ScLoanColorSchemeLight]; + } else if ([scheme isEqualToString:@"system"]) { + return [[ScLoanInfo alloc] initWithInteractionToken:interactionToken colorScheme:ScLoanColorSchemeSystem]; + } + } + return [[ScLoanInfo alloc] initWithInteractionToken:interactionToken]; +} + RCT_REMAP_METHOD(apply, loanInfo: (NSDictionary *)loanInfo applyWithResolver:(RCTPromiseResolveBlock)resolve @@ -640,7 +658,7 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject) NSString *interactionToken = loanInfo[@"interactionToken"]; NSLog(@" ----------- Interaction Token: %@", interactionToken); - ScLoanInfo *gatewayLoanInfo = [[ScLoanInfo alloc] initWithInteractionToken:interactionToken]; + ScLoanInfo *gatewayLoanInfo = [self loanInfoFromDict:loanInfo]; [ScLoan.instance applyWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] loanInfo:gatewayLoanInfo completion:^(ScLoanSuccess * success, ScLoanError * error) { @@ -667,7 +685,7 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject) NSString *interactionToken = loanInfo[@"interactionToken"]; NSLog(@" ----------- Interaction Token: %@", interactionToken); - ScLoanInfo *gatewayLoanInfo = [[ScLoanInfo alloc] initWithInteractionToken:interactionToken]; + ScLoanInfo *gatewayLoanInfo = [self loanInfoFromDict:loanInfo]; [ScLoan.instance payWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] loanInfo:gatewayLoanInfo completion:^(ScLoanSuccess * success, ScLoanError * error) { @@ -694,7 +712,7 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject) NSString *interactionToken = loanInfo[@"interactionToken"]; NSLog(@" ----------- Interaction Token: %@", interactionToken); - ScLoanInfo *gatewayLoanInfo = [[ScLoanInfo alloc] initWithInteractionToken:interactionToken]; + ScLoanInfo *gatewayLoanInfo = [self loanInfoFromDict:loanInfo]; [ScLoan.instance withdrawWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] loanInfo:gatewayLoanInfo completion:^(ScLoanSuccess * success, ScLoanError * error) { @@ -721,7 +739,7 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject) NSString *interactionToken = loanInfo[@"interactionToken"]; NSLog(@" ----------- Interaction Token: %@", interactionToken); - ScLoanInfo *gatewayLoanInfo = [[ScLoanInfo alloc] initWithInteractionToken:interactionToken]; + ScLoanInfo *gatewayLoanInfo = [self loanInfoFromDict:loanInfo]; [ScLoan.instance serviceWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] loanInfo:gatewayLoanInfo completion:^(ScLoanSuccess * success, ScLoanError * error) { @@ -749,7 +767,7 @@ @interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject) NSString *interactionToken = loanInfo[@"interactionToken"]; NSLog(@" ----------- Interaction Token: %@", interactionToken); - ScLoanInfo *gatewayLoanInfo = [[ScLoanInfo alloc] initWithInteractionToken:interactionToken]; + ScLoanInfo *gatewayLoanInfo = [self loanInfoFromDict:loanInfo]; [ScLoan.instance triggerInteractionWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] loanInfo:gatewayLoanInfo completion:^(ScLoanSuccess * success, ScLoanError * error) { diff --git a/react-native-smallcase-gateway.podspec b/react-native-smallcase-gateway.podspec index ef3a77e1..c3ddc34e 100644 --- a/react-native-smallcase-gateway.podspec +++ b/react-native-smallcase-gateway.podspec @@ -35,5 +35,7 @@ Pod::Spec.new do |s| end s.dependency 'SCGateway', '7.2.0' - s.dependency 'SCLoans', '7.1.2' + # INTERNAL TEST PIN: dark-theme branch build (mirrors the android/build.gradle pin). + # Revert to: s.dependency 'SCLoans', '7.2.0' + s.dependency 'SCLoans-sourav-native-dark-theme-0e85bd6', '7.1.2-44-release' end diff --git a/smart_investing_react_native/android/app/build.gradle b/smart_investing_react_native/android/app/build.gradle index 79df5317..9c3be87c 100644 --- a/smart_investing_react_native/android/app/build.gradle +++ b/smart_investing_react_native/android/app/build.gradle @@ -57,7 +57,7 @@ react { /** * Set this to true to Run Proguard on Release builds to minify the Java bytecode. */ -def enableProguardInReleaseBuilds = false +def enableProguardInReleaseBuilds = true /** * The preferred build flavor of JavaScriptCore (JSC) diff --git a/smart_investing_react_native/android/app/proguard-rules.pro b/smart_investing_react_native/android/app/proguard-rules.pro index 11b02572..08767865 100644 --- a/smart_investing_react_native/android/app/proguard-rules.pro +++ b/smart_investing_react_native/android/app/proguard-rules.pro @@ -8,3 +8,35 @@ # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: + +# SCLoans ships -repackageclasses 'com.smallcase.loans' as a consumer rule, which +# causes the host R8 to move 6 000+ external classes into com.smallcase.loans — +# colliding with the SDK's own pre-obfuscated classes and corrupting the Koin DI +# type graph at runtime (ClassCastException in wi/cm/o40 chain). +# -keeppackagenames overrides -repackageclasses per the ProGuard/R8 spec. +-keeppackagenames ** + +# SCGateway (com.smallcase.gateway:sdk) ships NO consumer proguard rules and its +# classes enter R8 with clear names, so the host R8 (full mode) freely obfuscates +# and merges its Dagger factories and Retrofit interfaces. That breaks +# retrofit.create(GatewayApiService) — the proxy cast fails at runtime with a +# ClassCastException routed through R8's synthetic ThrowCCE helper +# (FakeNetworkModule.provideGatewayApiService chain). Keep the SDK intact, +# mirroring the -keep that SCLoans already ships for itself. +-keep class com.smallcase.gateway.** { *; } + +# Retrofit + R8 full mode (AGP 8 default): generic signatures are stripped for +# any type that is not kept, so ConfigService.getBrokerConfigs(): Call +# degrades to a raw Call and Retrofit rejects it +# ("Call return type must be parameterized as Call"). These are the +# canonical rules Retrofit 2.9+ bundles in META-INF/proguard/retrofit2.pro; the +# gateway SDK vendors an older Retrofit whose embedded rules never reach the host, +# so we declare them here. allowobfuscation/allowshrinking keep the types +# "kept enough" to retain their generic signatures while still letting R8 rename them. +-keepattributes Signature, InnerClasses, EnclosingMethod +-keepclassmembers,allowshrinking,allowobfuscation interface * { + @retrofit2.http.* ; +} +-keep,allowobfuscation,allowshrinking interface retrofit2.Call +-keep,allowobfuscation,allowshrinking class retrofit2.Response +-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation diff --git a/smart_investing_react_native/android/gradle.properties b/smart_investing_react_native/android/gradle.properties index 92675fe8..2622857b 100644 --- a/smart_investing_react_native/android/gradle.properties +++ b/smart_investing_react_native/android/gradle.properties @@ -41,4 +41,8 @@ hermesEnabled=true artifactory_contextUrl=https\://artifactory.smallcase.com/artifactory artifactory_password=reactNativeUser123 -artifactory_user=react_native_user \ No newline at end of file +artifactory_user=react_native_user + +# R8 full mode stress test — loans SDK consumer-rules.pro verified safe 2026-07-01 +# Remove after confirming release build passes all P0 QA cases +android.enableR8.fullMode=true \ No newline at end of file diff --git a/smart_investing_react_native/app/screens/LoansScreen.tsx b/smart_investing_react_native/app/screens/LoansScreen.tsx index b6169a9b..35e3a821 100644 --- a/smart_investing_react_native/app/screens/LoansScreen.tsx +++ b/smart_investing_react_native/app/screens/LoansScreen.tsx @@ -16,10 +16,23 @@ import { import {SIJsonViewer} from '../components/SIJsonViewer'; import {SmartButton} from './HoldingsScreen'; import {SIDropDown} from '../components/SIDropdown'; +import SegmentedControl from '@react-native-segmented-control/segmented-control'; import {ScLoan} from 'react-native-smallcase-gateway'; type LoanSummaryType = Awaited>; +// Color scheme passed to the LAS web UI. Index 0 ("None") omits colorScheme +// entirely so the SDK keeps its "partner sent nothing → light" default; the +// rest map to the primitive string the native bridge expects. +type ScLoanColorScheme = 'light' | 'dark' | 'system'; +const COLOR_SCHEME_LABELS = ['None', 'Light', 'Dark', 'System']; +const COLOR_SCHEME_VALUES: (ScLoanColorScheme | undefined)[] = [ + undefined, + 'light', + 'dark', + 'system', +]; + export const basePayload = { intent: 'LOAN_APPLICATION', config: { @@ -63,6 +76,16 @@ const LoansScreen = ({route}: {route: any}) => { const [loanSummary, setLoanSummary] = useState(); const [offersInput] = useState(''); + // Selected LAS color scheme; defaults to index 0 ("None"). + const [colorSchemeIndex, setColorSchemeIndex] = useState(0); + + // Single source of truth for the ScLoanInfo passed to every trigger. When the + // selected scheme is "None" we omit the key so the SDK applies its default. + const buildLoanInfo = (token: string) => { + const colorScheme = COLOR_SCHEME_VALUES[colorSchemeIndex]; + return colorScheme ? {interactionToken: token, colorScheme} : {interactionToken: token}; + }; + const [createUnityUserPayload, setCreateUnityUserPayload] = useState({ id: '', @@ -227,9 +250,7 @@ const LoansScreen = ({route}: {route: any}) => { if (typeof interactionToken !== 'string') { throw new Error('Invalid interaction token!'); } - const applyRes = await ScLoan.apply({ - interactionToken: interactionToken, - }); + const applyRes = await ScLoan.apply(buildLoanInfo(interactionToken)); alert('Success', `${JSON.stringify(applyRes)}`); } catch (error: any) { alert('Error', `${error}, ${JSON.stringify(error.userInfo)}`); @@ -241,9 +262,7 @@ const LoansScreen = ({route}: {route: any}) => { if (typeof interactionToken !== 'string') { throw new Error('Invalid interaction token!'); } - const payRes = await ScLoan.pay({ - interactionToken: interactionToken, - }); + const payRes = await ScLoan.pay(buildLoanInfo(interactionToken)); alert('Success', `${JSON.stringify(payRes)}`); } catch (error: any) { alert('Error', `${error}, ${JSON.stringify(error.userInfo)}`); @@ -255,9 +274,7 @@ const LoansScreen = ({route}: {route: any}) => { if (typeof interactionToken !== 'string') { throw new Error('Invalid interaction token!'); } - const withdrawRes = await ScLoan.withdraw({ - interactionToken: interactionToken, - }); + const withdrawRes = await ScLoan.withdraw(buildLoanInfo(interactionToken)); alert('Success', `${JSON.stringify(withdrawRes)}`); } catch (error: any) { alert('Error', `${error}, ${JSON.stringify(error.userInfo)}`); @@ -269,9 +286,7 @@ const LoansScreen = ({route}: {route: any}) => { if (typeof interactionToken !== 'string') { throw new Error('Invalid interaction token!'); } - const serviceRes = await ScLoan.service({ - interactionToken: interactionToken, - }); + const serviceRes = await ScLoan.service(buildLoanInfo(interactionToken)); alert('Success', `${JSON.stringify(serviceRes)}`); } catch (error: any) { alert('Error', `${error}, ${JSON.stringify(error.userInfo)}`); @@ -283,9 +298,9 @@ const LoansScreen = ({route}: {route: any}) => { if (typeof interactionToken !== 'string') { throw new Error('Invalid interaction token!'); } - const serviceRes = await ScLoan.triggerInteraction({ - interactionToken: interactionToken, - }); + const serviceRes = await ScLoan.triggerInteraction( + buildLoanInfo(interactionToken), + ); alert('Success', `${JSON.stringify(serviceRes)}`); } catch (error: any) { alert('Error', `${error}, ${JSON.stringify(error.userInfo)}`); @@ -515,6 +530,18 @@ const LoansScreen = ({route}: {route: any}) => { }} title={'Setup'} /> + + + Color Scheme + + { + setColorSchemeIndex(event.nativeEvent.selectedSegmentIndex); + }} + /> + diff --git a/smart_investing_react_native/ios/Podfile.lock b/smart_investing_react_native/ios/Podfile.lock index 4ee96042..19a52421 100644 --- a/smart_investing_react_native/ios/Podfile.lock +++ b/smart_investing_react_native/ios/Podfile.lock @@ -1410,14 +1410,14 @@ PODS: - Yoga - react-native-segmented-control (2.5.7): - React-Core - - react-native-smallcase-gateway (7.3.6): + - react-native-smallcase-gateway (7.4.3): - RCTRequired - RCTTypeSafety - React-Codegen - React-Core - ReactCommon/turbomodule/core - - SCGateway (= 7.1.7) - - SCLoans (= 7.1.2) + - SCGateway (= 7.2.0) + - SCLoans-sourav-native-dark-theme-0e85bd6 (= 7.1.2-44-release) - React-NativeModulesApple (0.79.4): - glog - hermes-engine @@ -1839,8 +1839,8 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - SCGateway (7.1.7) - - SCLoans (7.1.2) + - SCGateway (7.2.0) + - SCLoans-sourav-native-dark-theme-0e85bd6 (7.1.2-44-release) - SocketRocket (0.7.1) - Yoga (0.0.0) @@ -1925,10 +1925,11 @@ DEPENDENCIES: - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: + https://github.com/smallcase/cocoapodspec-internal.git: + - SCLoans-sourav-native-dark-theme-0e85bd6 trunk: - React-Codegen - SCGateway - - SCLoans - SocketRocket EXTERNAL SOURCES: @@ -2128,7 +2129,7 @@ SPEC CHECKSUMS: React-microtasksnativemodule: ef2292ca147fa8793305e4693586ad0caf3afad3 react-native-safe-area-context: 562163222d999b79a51577eda2ea8ad2c32b4d06 react-native-segmented-control: bf6e0032726727498e18dd437ae88afcdbc18e99 - react-native-smallcase-gateway: 5af44ebaee1d5326befe862f0cf8cb00143f1098 + react-native-smallcase-gateway: 8e5836a403989efd924992c552fbfdf57dea8a65 React-NativeModulesApple: da60186ad0aafff031a9bc86b048711d34acc813 React-oscompat: 472a446c740e39ee39cd57cd7bfd32177c763a2b React-perflogger: bbca3688c62f4f39e972d6e21969c95fe441fb6c @@ -2163,8 +2164,8 @@ SPEC CHECKSUMS: RNCClipboard: 37de6995ef72dc869422879e51a46a520d3f08b3 RNGestureHandler: ebef699ea17e7c0006c1074e1e423ead60ce0121 RNScreens: 3f6e41f9f89cb888a6b4b27566bdfdf7a3bf51ad - SCGateway: a0f1bc86e449c7d440d8661e0936095b6f345179 - SCLoans: 4accc0a0a483f3943cc513a50800485201fed4dd + SCGateway: 8089d79c55ecc8e7b581e0bf56fd28a2e3d957d0 + SCLoans-sourav-native-dark-theme-0e85bd6: 98e7ffbfcc0da3bc0571caeaaf353ae4a7914dfa SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: a6cb833e04fb8c59a012b49fb1d040fcb0cbb633 diff --git a/smart_investing_react_native/yarn.lock b/smart_investing_react_native/yarn.lock index fc876c83..6f22fca7 100644 --- a/smart_investing_react_native/yarn.lock +++ b/smart_investing_react_native/yarn.lock @@ -4132,6 +4132,13 @@ hasown@^2.0.2: dependencies: function-bind "^1.1.2" +hasown@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.4.tgz#8c62d8cb90beb2aad5d0a5b67581ad9854c3f003" + integrity sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A== + dependencies: + function-bind "^1.1.2" + hermes-estree@0.25.1: version "0.25.1" resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.25.1.tgz#6aeec17d1983b4eabf69721f3aa3eb705b17f480" @@ -4346,13 +4353,20 @@ is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.16.1, is-core-module@^2.5.0: +is-core-module@^2.16.1: version "2.16.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== dependencies: hasown "^2.0.2" +is-core-module@^2.5.0: + version "2.16.2" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.2.tgz#3e07450a8080ebce3fbf0cac494f4d2ab324e082" + integrity sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA== + dependencies: + hasown "^2.0.3" + is-data-view@^1.0.1, is-data-view@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-data-view/-/is-data-view-1.0.2.tgz#bae0a41b9688986c2188dda6657e56b8f9e63b8e" @@ -6198,7 +6212,7 @@ react-native-screens@4.17.1: warn-once "^0.1.0" "react-native-smallcase-gateway@file:..": - version "7.3.6" + version "7.4.3" dependencies: standard-version "^9.5.0" @@ -6432,7 +6446,17 @@ resolve.exports@^2.0.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.3.tgz#41955e6f1b4013b7586f873749a635dea07ebe3f" integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== -resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.11: +resolve@^1.10.0: + version "1.22.12" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.12.tgz#f5b2a680897c69c238a13cd16b15671f8b73549f" + integrity sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA== + dependencies: + es-errors "^1.3.0" + is-core-module "^2.16.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +resolve@^1.20.0, resolve@^1.22.11: version "1.22.11" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.11.tgz#aad857ce1ffb8bfa9b0b1ac29f1156383f68c262" integrity sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ== @@ -6538,7 +6562,12 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.1.1, semver@^7.1.3, semver@^7.3.4, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0: +semver@^7.1.1, semver@^7.3.4: + version "7.8.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.8.5.tgz#39b646037dd50c14fb451e7e4cac58ed8b863f69" + integrity sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA== + +semver@^7.1.3, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0: version "7.7.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a" integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA== @@ -7532,9 +7561,9 @@ yargs@^15.1.0: yargs-parser "^18.1.2" yargs@^16.0.0, yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + version "16.2.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.2.tgz#c56731dca0d2788ae0866dd3c83907d6bab85f7d" + integrity sha512-Nt9ZJjXTv5R8MHbqby/wXQ6Gi0Bb3TcYZkR1bzuL4yB2OxWPkXknz513gEF0GoA6tn00UpbPvERW8rzCuWCA6w== dependencies: cliui "^7.0.2" escalade "^3.1.1" diff --git a/src/ScLoan.js b/src/ScLoan.js index a0c32735..604448f2 100644 --- a/src/ScLoan.js +++ b/src/ScLoan.js @@ -11,6 +11,9 @@ const { SmallcaseGateway: SmallcaseGatewayNative } = NativeModules; * * @typedef {Object} ScLoanInfo * @property {String} interactionToken + * @property {'dark' | 'light' | 'system'} [colorScheme] - color scheme for the LAS web UI. + * Pass `dark`/`light` when your app has a resolved theme, `system` to mirror the device, + * or omit to let the web app default to light for partner sessions. * * @typedef {Object} ScLoanSuccess * @property {boolean} isSuccess diff --git a/types/ScLoan.d.ts b/types/ScLoan.d.ts index 3d0a4723..7a093261 100644 --- a/types/ScLoan.d.ts +++ b/types/ScLoan.d.ts @@ -8,6 +8,7 @@ export type ScLoanConfig = { }; export type ScLoanInfo = { interactionToken: string; + colorScheme?: 'dark' | 'light' | 'system'; }; export type ScLoanSuccess = { isSuccess: boolean; @@ -34,6 +35,9 @@ declare namespace ScLoan { * * @typedef {Object} ScLoanInfo * @property {String} interactionToken + * @property {'dark' | 'light' | 'system'} [colorScheme] - color scheme for the LAS web UI. + * Pass `dark`/`light` when your app has a resolved theme, `system` to mirror the device, + * or omit to let the web app default to light for partner sessions. * * @typedef {Object} ScLoanSuccess * @property {boolean} isSuccess