cactus-react-native 1.5.0 → 1.10.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/Cactus.podspec +1 -1
- package/README.md +347 -241
- package/android/CMakeLists.txt +24 -5
- package/android/src/main/jniLibs/arm64-v8a/libcactus.a +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcurl.a +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libmbedcrypto.a +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libmbedtls.a +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libmbedx509.a +0 -0
- package/cpp/HybridCactus.cpp +197 -117
- package/cpp/HybridCactus.hpp +18 -9
- package/cpp/cactus_ffi.h +66 -42
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus.h +0 -1
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_cloud.h +48 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_ffi.h +66 -42
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_utils.h +568 -135
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/engine.h +148 -17
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +145 -36
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +187 -6
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel_utils.h +49 -149
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus.h +0 -1
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_cloud.h +48 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_ffi.h +66 -42
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_utils.h +568 -135
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/engine.h +148 -17
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +145 -36
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +187 -6
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel_utils.h +49 -149
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/_CodeSignature/CodeResources +1 -1
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/cactus +0 -0
- package/lib/module/classes/CactusLM.js +16 -49
- package/lib/module/classes/CactusLM.js.map +1 -1
- package/lib/module/classes/CactusSTT.js +41 -75
- package/lib/module/classes/CactusSTT.js.map +1 -1
- package/lib/module/classes/CactusVAD.js +95 -0
- package/lib/module/classes/CactusVAD.js.map +1 -0
- package/lib/module/hooks/useCactusLM.js +10 -11
- package/lib/module/hooks/useCactusLM.js.map +1 -1
- package/lib/module/hooks/useCactusSTT.js +23 -62
- package/lib/module/hooks/useCactusSTT.js.map +1 -1
- package/lib/module/hooks/useCactusVAD.js +171 -0
- package/lib/module/hooks/useCactusVAD.js.map +1 -0
- package/lib/module/index.js +2 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/modelRegistry.js +52 -0
- package/lib/module/modelRegistry.js.map +1 -0
- package/lib/module/native/Cactus.js +103 -23
- package/lib/module/native/Cactus.js.map +1 -1
- package/lib/module/native/CactusIndex.js.map +1 -1
- package/lib/module/native/index.js +0 -3
- package/lib/module/native/index.js.map +1 -1
- package/lib/module/types/CactusVAD.js +4 -0
- package/lib/module/{specs/CactusUtil.nitro.js.map → types/CactusVAD.js.map} +1 -1
- package/lib/typescript/src/classes/CactusLM.d.ts +5 -7
- package/lib/typescript/src/classes/CactusLM.d.ts.map +1 -1
- package/lib/typescript/src/classes/CactusSTT.d.ts +9 -12
- package/lib/typescript/src/classes/CactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/classes/CactusVAD.d.ts +20 -0
- package/lib/typescript/src/classes/CactusVAD.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCactusLM.d.ts +2 -2
- package/lib/typescript/src/hooks/useCactusLM.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCactusSTT.d.ts +6 -8
- package/lib/typescript/src/hooks/useCactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCactusVAD.d.ts +15 -0
- package/lib/typescript/src/hooks/useCactusVAD.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -5
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/modelRegistry.d.ts +5 -0
- package/lib/typescript/src/modelRegistry.d.ts.map +1 -0
- package/lib/typescript/src/native/Cactus.d.ts +13 -11
- package/lib/typescript/src/native/Cactus.d.ts.map +1 -1
- package/lib/typescript/src/native/CactusIndex.d.ts +2 -2
- package/lib/typescript/src/native/CactusIndex.d.ts.map +1 -1
- package/lib/typescript/src/native/index.d.ts +0 -3
- package/lib/typescript/src/native/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/Cactus.nitro.d.ts +7 -6
- package/lib/typescript/src/specs/Cactus.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusIndex.d.ts +2 -2
- package/lib/typescript/src/types/CactusIndex.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusLM.d.ts +19 -11
- package/lib/typescript/src/types/CactusLM.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusSTT.d.ts +44 -12
- package/lib/typescript/src/types/CactusSTT.d.ts.map +1 -1
- package/lib/typescript/src/types/CactusVAD.d.ts +34 -0
- package/lib/typescript/src/types/CactusVAD.d.ts.map +1 -0
- package/lib/typescript/src/types/common.d.ts +1 -6
- package/lib/typescript/src/types/common.d.ts.map +1 -1
- package/nitro.json +0 -11
- package/nitrogen/generated/android/cactus+autolinking.cmake +0 -5
- package/nitrogen/generated/android/cactusOnLoad.cpp +0 -30
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.cpp +0 -50
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.hpp +9 -147
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Umbrella.hpp +0 -13
- package/nitrogen/generated/ios/CactusAutolinking.mm +0 -26
- package/nitrogen/generated/ios/CactusAutolinking.swift +0 -30
- package/nitrogen/generated/shared/c++/HybridCactusSpec.cpp +5 -4
- package/nitrogen/generated/shared/c++/HybridCactusSpec.hpp +7 -6
- package/package.json +3 -3
- package/src/classes/CactusLM.ts +18 -65
- package/src/classes/CactusSTT.ts +52 -90
- package/src/classes/CactusVAD.ts +129 -0
- package/src/hooks/useCactusLM.ts +14 -17
- package/src/hooks/useCactusSTT.ts +47 -98
- package/src/hooks/useCactusVAD.ts +215 -0
- package/src/index.tsx +21 -12
- package/src/modelRegistry.ts +65 -0
- package/src/native/Cactus.ts +131 -38
- package/src/native/CactusIndex.ts +2 -2
- package/src/native/index.ts +0 -3
- package/src/specs/Cactus.nitro.ts +16 -7
- package/src/types/CactusIndex.ts +2 -2
- package/src/types/CactusLM.ts +19 -11
- package/src/types/CactusSTT.ts +47 -13
- package/src/types/CactusVAD.ts +39 -0
- package/src/types/common.ts +1 -6
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusCrypto.kt +0 -46
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusDeviceInfo.kt +0 -27
- package/android/src/main/jniLibs/arm64-v8a/libcactus_util.a +0 -0
- package/cpp/HybridCactusUtil.cpp +0 -47
- package/cpp/HybridCactusUtil.hpp +0 -27
- package/cpp/cactus_util.h +0 -25
- package/ios/HybridCactusCrypto.swift +0 -37
- package/ios/HybridCactusDeviceInfo.swift +0 -32
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_telemetry.h +0 -656
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_telemetry.h +0 -656
- package/ios/cactus_util.xcframework/Info.plist +0 -39
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/cactus_util.h +0 -25
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/database.h +0 -27
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/ios_utils.h +0 -10
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/logging.h +0 -25
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Info.plist +0 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/cactus_util +0 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/cactus_util.h +0 -25
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/database.h +0 -27
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/ios_utils.h +0 -10
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/logging.h +0 -25
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Info.plist +0 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/_CodeSignature/CodeResources +0 -135
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/cactus_util +0 -0
- package/lib/module/api/Database.js +0 -45
- package/lib/module/api/Database.js.map +0 -1
- package/lib/module/api/RemoteLM.js +0 -201
- package/lib/module/api/RemoteLM.js.map +0 -1
- package/lib/module/config/CactusConfig.js +0 -12
- package/lib/module/config/CactusConfig.js.map +0 -1
- package/lib/module/models.js +0 -336
- package/lib/module/models.js.map +0 -1
- package/lib/module/native/CactusCrypto.js +0 -10
- package/lib/module/native/CactusCrypto.js.map +0 -1
- package/lib/module/native/CactusDeviceInfo.js +0 -13
- package/lib/module/native/CactusDeviceInfo.js.map +0 -1
- package/lib/module/native/CactusUtil.js +0 -36
- package/lib/module/native/CactusUtil.js.map +0 -1
- package/lib/module/specs/CactusCrypto.nitro.js +0 -4
- package/lib/module/specs/CactusCrypto.nitro.js.map +0 -1
- package/lib/module/specs/CactusDeviceInfo.nitro.js +0 -4
- package/lib/module/specs/CactusDeviceInfo.nitro.js.map +0 -1
- package/lib/module/specs/CactusUtil.nitro.js +0 -4
- package/lib/module/telemetry/Telemetry.js +0 -154
- package/lib/module/telemetry/Telemetry.js.map +0 -1
- package/lib/typescript/src/api/Database.d.ts +0 -12
- package/lib/typescript/src/api/Database.d.ts.map +0 -1
- package/lib/typescript/src/api/RemoteLM.d.ts +0 -14
- package/lib/typescript/src/api/RemoteLM.d.ts.map +0 -1
- package/lib/typescript/src/config/CactusConfig.d.ts +0 -7
- package/lib/typescript/src/config/CactusConfig.d.ts.map +0 -1
- package/lib/typescript/src/models.d.ts +0 -6
- package/lib/typescript/src/models.d.ts.map +0 -1
- package/lib/typescript/src/native/CactusCrypto.d.ts +0 -5
- package/lib/typescript/src/native/CactusCrypto.d.ts.map +0 -1
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts +0 -7
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts.map +0 -1
- package/lib/typescript/src/native/CactusUtil.d.ts +0 -6
- package/lib/typescript/src/native/CactusUtil.d.ts.map +0 -1
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts +0 -8
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts.map +0 -1
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts +0 -16
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts.map +0 -1
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts +0 -10
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts.map +0 -1
- package/lib/typescript/src/telemetry/Telemetry.d.ts +0 -34
- package/lib/typescript/src/telemetry/Telemetry.d.ts.map +0 -1
- package/nitrogen/generated/android/c++/JDeviceInfo.hpp +0 -74
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.cpp +0 -65
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.hpp +0 -65
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.cpp +0 -85
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.hpp +0 -66
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/DeviceInfo.kt +0 -50
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusCryptoSpec.kt +0 -58
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusDeviceInfoSpec.kt +0 -62
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.hpp +0 -77
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.hpp +0 -88
- package/nitrogen/generated/ios/swift/DeviceInfo.swift +0 -98
- package/nitrogen/generated/ios/swift/Func_void_DeviceInfo.swift +0 -47
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +0 -54
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec.swift +0 -57
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec_cxx.swift +0 -139
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec.swift +0 -58
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec_cxx.swift +0 -164
- package/nitrogen/generated/shared/c++/DeviceInfo.hpp +0 -92
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.cpp +0 -21
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.hpp +0 -63
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.cpp +0 -22
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.hpp +0 -67
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.cpp +0 -23
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.hpp +0 -66
- package/src/api/Database.ts +0 -55
- package/src/api/RemoteLM.ts +0 -273
- package/src/config/CactusConfig.ts +0 -11
- package/src/models.ts +0 -344
- package/src/native/CactusCrypto.ts +0 -11
- package/src/native/CactusDeviceInfo.ts +0 -18
- package/src/native/CactusUtil.ts +0 -43
- package/src/specs/CactusCrypto.nitro.ts +0 -6
- package/src/specs/CactusDeviceInfo.nitro.ts +0 -15
- package/src/specs/CactusUtil.nitro.ts +0 -8
- package/src/telemetry/Telemetry.ts +0 -236
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,QAAA,MAAM,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAA;CAmVzC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusCrypto.d.ts","sourceRoot":"","sources":["../../../../src/native/CactusCrypto.ts"],"names":[],"mappings":"AAGA,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAC0B;WAEtD,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG3E"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DeviceInfo } from '../specs/CactusDeviceInfo.nitro';
|
|
2
|
-
export declare class CactusDeviceInfo {
|
|
3
|
-
private static readonly hybridCactusDeviceInfo;
|
|
4
|
-
static getAppIdentifier(): Promise<string | undefined>;
|
|
5
|
-
static getDeviceInfo(): Promise<DeviceInfo>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=CactusDeviceInfo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusDeviceInfo.d.ts","sourceRoot":"","sources":["../../../../src/native/CactusDeviceInfo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,UAAU,EACX,MAAM,iCAAiC,CAAC;AAEzC,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAC8B;WAE9D,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;WAI/C,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC;CAGnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusUtil.d.ts","sourceRoot":"","sources":["../../../../src/native/CactusUtil.ts"],"names":[],"mappings":"AAOA,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CACwB;WAE5C,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;WASnD,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAsB1D"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
export interface CactusCrypto extends HybridObject<{
|
|
3
|
-
ios: 'swift';
|
|
4
|
-
android: 'kotlin';
|
|
5
|
-
}> {
|
|
6
|
-
uuidv5(namespaceUuid: string, name: string): Promise<string>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=CactusCrypto.nitro.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusCrypto.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/CactusCrypto.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,YACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACzD,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9D"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
export interface DeviceInfo {
|
|
3
|
-
brand: string;
|
|
4
|
-
model: string;
|
|
5
|
-
device_id?: string;
|
|
6
|
-
os: string;
|
|
7
|
-
os_version: string;
|
|
8
|
-
}
|
|
9
|
-
export interface CactusDeviceInfo extends HybridObject<{
|
|
10
|
-
ios: 'swift';
|
|
11
|
-
android: 'kotlin';
|
|
12
|
-
}> {
|
|
13
|
-
getAppIdentifier(): Promise<string | undefined>;
|
|
14
|
-
getDeviceInfo(): Promise<DeviceInfo>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=CactusDeviceInfo.nitro.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusDeviceInfo.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/CactusDeviceInfo.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACzD,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAChD,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CACtC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
export interface CactusUtil extends HybridObject<{
|
|
3
|
-
ios: 'c++';
|
|
4
|
-
android: 'c++';
|
|
5
|
-
}> {
|
|
6
|
-
registerApp(encryptedData: string): Promise<string>;
|
|
7
|
-
getDeviceId(token?: string): Promise<string | null>;
|
|
8
|
-
setAndroidDataDirectory(dataDir: string): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=CactusUtil.nitro.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CactusUtil.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/CactusUtil.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,UACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;IACpD,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACpD,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { CactusLMCompleteResult } from '../types/CactusLM';
|
|
2
|
-
import type { CactusSTTTranscribeResult } from '../types/CactusSTT';
|
|
3
|
-
export interface LogRecord {
|
|
4
|
-
framework: 'react-native';
|
|
5
|
-
framework_version: string;
|
|
6
|
-
event_type: 'init' | 'completion' | 'transcription' | 'embedding' | 'image_embedding' | 'audio_embedding';
|
|
7
|
-
model: string;
|
|
8
|
-
success: boolean;
|
|
9
|
-
message?: string;
|
|
10
|
-
telemetry_token?: string;
|
|
11
|
-
project_id?: string;
|
|
12
|
-
device_id?: string;
|
|
13
|
-
tokens?: number;
|
|
14
|
-
response_time?: number;
|
|
15
|
-
ttft?: number;
|
|
16
|
-
tps?: number;
|
|
17
|
-
}
|
|
18
|
-
export declare class Telemetry {
|
|
19
|
-
private static cactusTelemetryToken?;
|
|
20
|
-
private static projectId?;
|
|
21
|
-
private static deviceId?;
|
|
22
|
-
private static readonly namespaceUrl;
|
|
23
|
-
private static readonly logBufferPaths;
|
|
24
|
-
private static handleLog;
|
|
25
|
-
static isInitialized(): boolean;
|
|
26
|
-
static init(cactusTelemetryToken?: string): Promise<void>;
|
|
27
|
-
static logInit(model: string, success: boolean, message?: string): Promise<void>;
|
|
28
|
-
static logCompletion(model: string, success: boolean, message?: string, result?: CactusLMCompleteResult): Promise<void>;
|
|
29
|
-
static logTranscribe(model: string, success: boolean, message?: string, result?: CactusSTTTranscribeResult): Promise<void>;
|
|
30
|
-
static logEmbedding(model: string, success: boolean, message?: string): Promise<void>;
|
|
31
|
-
static logImageEmbedding(model: string, success: boolean, message?: string): Promise<void>;
|
|
32
|
-
static logAudioEmbedding(model: string, success: boolean, message?: string): Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=Telemetry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Telemetry.d.ts","sourceRoot":"","sources":["../../../../src/telemetry/Telemetry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,WAAW,SAAS;IAExB,SAAS,EAAE,cAAc,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAG1B,UAAU,EACN,MAAM,GACN,YAAY,GACZ,eAAe,GACf,WAAW,GACX,iBAAiB,GACjB,iBAAiB,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAS;IAC7C,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAS;IAClC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAS;IAEjC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAA0C;IAC9E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAOpC;mBAEmB,SAAS;WAiChB,aAAa,IAAI,OAAO;WAIlB,IAAI,CAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;WAyBxD,OAAO,CACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;WAcF,aAAa,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC;WAkBF,aAAa,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC;WAkBF,YAAY,CACxB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;WAcF,iBAAiB,CAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;WAcF,iBAAiB,CAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;CAajB"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JDeviceInfo.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <fbjni/fbjni.h>
|
|
11
|
-
#include "DeviceInfo.hpp"
|
|
12
|
-
|
|
13
|
-
#include <optional>
|
|
14
|
-
#include <string>
|
|
15
|
-
|
|
16
|
-
namespace margelo::nitro::cactus {
|
|
17
|
-
|
|
18
|
-
using namespace facebook;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The C++ JNI bridge between the C++ struct "DeviceInfo" and the the Kotlin data class "DeviceInfo".
|
|
22
|
-
*/
|
|
23
|
-
struct JDeviceInfo final: public jni::JavaClass<JDeviceInfo> {
|
|
24
|
-
public:
|
|
25
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cactus/DeviceInfo;";
|
|
26
|
-
|
|
27
|
-
public:
|
|
28
|
-
/**
|
|
29
|
-
* Convert this Java/Kotlin-based struct to the C++ struct DeviceInfo by copying all values to C++.
|
|
30
|
-
*/
|
|
31
|
-
[[maybe_unused]]
|
|
32
|
-
[[nodiscard]]
|
|
33
|
-
DeviceInfo toCpp() const {
|
|
34
|
-
static const auto clazz = javaClassStatic();
|
|
35
|
-
static const auto fieldBrand = clazz->getField<jni::JString>("brand");
|
|
36
|
-
jni::local_ref<jni::JString> brand = this->getFieldValue(fieldBrand);
|
|
37
|
-
static const auto fieldModel = clazz->getField<jni::JString>("model");
|
|
38
|
-
jni::local_ref<jni::JString> model = this->getFieldValue(fieldModel);
|
|
39
|
-
static const auto fieldDevice_id = clazz->getField<jni::JString>("device_id");
|
|
40
|
-
jni::local_ref<jni::JString> device_id = this->getFieldValue(fieldDevice_id);
|
|
41
|
-
static const auto fieldOs = clazz->getField<jni::JString>("os");
|
|
42
|
-
jni::local_ref<jni::JString> os = this->getFieldValue(fieldOs);
|
|
43
|
-
static const auto fieldOs_version = clazz->getField<jni::JString>("os_version");
|
|
44
|
-
jni::local_ref<jni::JString> os_version = this->getFieldValue(fieldOs_version);
|
|
45
|
-
return DeviceInfo(
|
|
46
|
-
brand->toStdString(),
|
|
47
|
-
model->toStdString(),
|
|
48
|
-
device_id != nullptr ? std::make_optional(device_id->toStdString()) : std::nullopt,
|
|
49
|
-
os->toStdString(),
|
|
50
|
-
os_version->toStdString()
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public:
|
|
55
|
-
/**
|
|
56
|
-
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
57
|
-
*/
|
|
58
|
-
[[maybe_unused]]
|
|
59
|
-
static jni::local_ref<JDeviceInfo::javaobject> fromCpp(const DeviceInfo& value) {
|
|
60
|
-
using JSignature = JDeviceInfo(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
61
|
-
static const auto clazz = javaClassStatic();
|
|
62
|
-
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
63
|
-
return create(
|
|
64
|
-
clazz,
|
|
65
|
-
jni::make_jstring(value.brand),
|
|
66
|
-
jni::make_jstring(value.model),
|
|
67
|
-
value.device_id.has_value() ? jni::make_jstring(value.device_id.value()) : nullptr,
|
|
68
|
-
jni::make_jstring(value.os),
|
|
69
|
-
jni::make_jstring(value.os_version)
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
} // namespace margelo::nitro::cactus
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JHybridCactusCryptoSpec.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "JHybridCactusCryptoSpec.hpp"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
#include <string>
|
|
13
|
-
#include <NitroModules/Promise.hpp>
|
|
14
|
-
#include <NitroModules/JPromise.hpp>
|
|
15
|
-
|
|
16
|
-
namespace margelo::nitro::cactus {
|
|
17
|
-
|
|
18
|
-
jni::local_ref<JHybridCactusCryptoSpec::jhybriddata> JHybridCactusCryptoSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
19
|
-
return makeCxxInstance(jThis);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
void JHybridCactusCryptoSpec::registerNatives() {
|
|
23
|
-
registerHybrid({
|
|
24
|
-
makeNativeMethod("initHybrid", JHybridCactusCryptoSpec::initHybrid),
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
size_t JHybridCactusCryptoSpec::getExternalMemorySize() noexcept {
|
|
29
|
-
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
30
|
-
return method(_javaPart);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
void JHybridCactusCryptoSpec::dispose() noexcept {
|
|
34
|
-
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
35
|
-
method(_javaPart);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
std::string JHybridCactusCryptoSpec::toString() {
|
|
39
|
-
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
40
|
-
auto javaString = method(_javaPart);
|
|
41
|
-
return javaString->toStdString();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Properties
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// Methods
|
|
48
|
-
std::shared_ptr<Promise<std::string>> JHybridCactusCryptoSpec::uuidv5(const std::string& namespaceUuid, const std::string& name) {
|
|
49
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>(jni::alias_ref<jni::JString> /* namespaceUuid */, jni::alias_ref<jni::JString> /* name */)>("uuidv5");
|
|
50
|
-
auto __result = method(_javaPart, jni::make_jstring(namespaceUuid), jni::make_jstring(name));
|
|
51
|
-
return [&]() {
|
|
52
|
-
auto __promise = Promise<std::string>::create();
|
|
53
|
-
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
54
|
-
auto __result = jni::static_ref_cast<jni::JString>(__boxedResult);
|
|
55
|
-
__promise->resolve(__result->toStdString());
|
|
56
|
-
});
|
|
57
|
-
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
58
|
-
jni::JniException __jniError(__throwable);
|
|
59
|
-
__promise->reject(std::make_exception_ptr(__jniError));
|
|
60
|
-
});
|
|
61
|
-
return __promise;
|
|
62
|
-
}();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
} // namespace margelo::nitro::cactus
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridCactusCryptoSpec.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
-
#include <fbjni/fbjni.h>
|
|
12
|
-
#include "HybridCactusCryptoSpec.hpp"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
namespace margelo::nitro::cactus {
|
|
18
|
-
|
|
19
|
-
using namespace facebook;
|
|
20
|
-
|
|
21
|
-
class JHybridCactusCryptoSpec: public jni::HybridClass<JHybridCactusCryptoSpec, JHybridObject>,
|
|
22
|
-
public virtual HybridCactusCryptoSpec {
|
|
23
|
-
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cactus/HybridCactusCryptoSpec;";
|
|
25
|
-
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
-
static void registerNatives();
|
|
27
|
-
|
|
28
|
-
protected:
|
|
29
|
-
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
-
explicit JHybridCactusCryptoSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
-
HybridObject(HybridCactusCryptoSpec::TAG),
|
|
32
|
-
HybridBase(jThis),
|
|
33
|
-
_javaPart(jni::make_global(jThis)) {}
|
|
34
|
-
|
|
35
|
-
public:
|
|
36
|
-
~JHybridCactusCryptoSpec() override {
|
|
37
|
-
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
|
-
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public:
|
|
42
|
-
size_t getExternalMemorySize() noexcept override;
|
|
43
|
-
void dispose() noexcept override;
|
|
44
|
-
std::string toString() override;
|
|
45
|
-
|
|
46
|
-
public:
|
|
47
|
-
inline const jni::global_ref<JHybridCactusCryptoSpec::javaobject>& getJavaPart() const noexcept {
|
|
48
|
-
return _javaPart;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public:
|
|
52
|
-
// Properties
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
public:
|
|
56
|
-
// Methods
|
|
57
|
-
std::shared_ptr<Promise<std::string>> uuidv5(const std::string& namespaceUuid, const std::string& name) override;
|
|
58
|
-
|
|
59
|
-
private:
|
|
60
|
-
friend HybridBase;
|
|
61
|
-
using HybridBase::HybridBase;
|
|
62
|
-
jni::global_ref<JHybridCactusCryptoSpec::javaobject> _javaPart;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
} // namespace margelo::nitro::cactus
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// JHybridCactusDeviceInfoSpec.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "JHybridCactusDeviceInfoSpec.hpp"
|
|
9
|
-
|
|
10
|
-
// Forward declaration of `DeviceInfo` to properly resolve imports.
|
|
11
|
-
namespace margelo::nitro::cactus { struct DeviceInfo; }
|
|
12
|
-
|
|
13
|
-
#include <string>
|
|
14
|
-
#include <optional>
|
|
15
|
-
#include <NitroModules/Promise.hpp>
|
|
16
|
-
#include <NitroModules/JPromise.hpp>
|
|
17
|
-
#include "DeviceInfo.hpp"
|
|
18
|
-
#include "JDeviceInfo.hpp"
|
|
19
|
-
|
|
20
|
-
namespace margelo::nitro::cactus {
|
|
21
|
-
|
|
22
|
-
jni::local_ref<JHybridCactusDeviceInfoSpec::jhybriddata> JHybridCactusDeviceInfoSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
23
|
-
return makeCxxInstance(jThis);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
void JHybridCactusDeviceInfoSpec::registerNatives() {
|
|
27
|
-
registerHybrid({
|
|
28
|
-
makeNativeMethod("initHybrid", JHybridCactusDeviceInfoSpec::initHybrid),
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
size_t JHybridCactusDeviceInfoSpec::getExternalMemorySize() noexcept {
|
|
33
|
-
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
34
|
-
return method(_javaPart);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
void JHybridCactusDeviceInfoSpec::dispose() noexcept {
|
|
38
|
-
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
39
|
-
method(_javaPart);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
std::string JHybridCactusDeviceInfoSpec::toString() {
|
|
43
|
-
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
44
|
-
auto javaString = method(_javaPart);
|
|
45
|
-
return javaString->toStdString();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Properties
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// Methods
|
|
52
|
-
std::shared_ptr<Promise<std::optional<std::string>>> JHybridCactusDeviceInfoSpec::getAppIdentifier() {
|
|
53
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getAppIdentifier");
|
|
54
|
-
auto __result = method(_javaPart);
|
|
55
|
-
return [&]() {
|
|
56
|
-
auto __promise = Promise<std::optional<std::string>>::create();
|
|
57
|
-
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
58
|
-
auto __result = jni::static_ref_cast<jni::JString>(__boxedResult);
|
|
59
|
-
__promise->resolve(__result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt);
|
|
60
|
-
});
|
|
61
|
-
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
62
|
-
jni::JniException __jniError(__throwable);
|
|
63
|
-
__promise->reject(std::make_exception_ptr(__jniError));
|
|
64
|
-
});
|
|
65
|
-
return __promise;
|
|
66
|
-
}();
|
|
67
|
-
}
|
|
68
|
-
std::shared_ptr<Promise<DeviceInfo>> JHybridCactusDeviceInfoSpec::getDeviceInfo() {
|
|
69
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getDeviceInfo");
|
|
70
|
-
auto __result = method(_javaPart);
|
|
71
|
-
return [&]() {
|
|
72
|
-
auto __promise = Promise<DeviceInfo>::create();
|
|
73
|
-
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
74
|
-
auto __result = jni::static_ref_cast<JDeviceInfo>(__boxedResult);
|
|
75
|
-
__promise->resolve(__result->toCpp());
|
|
76
|
-
});
|
|
77
|
-
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
78
|
-
jni::JniException __jniError(__throwable);
|
|
79
|
-
__promise->reject(std::make_exception_ptr(__jniError));
|
|
80
|
-
});
|
|
81
|
-
return __promise;
|
|
82
|
-
}();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
} // namespace margelo::nitro::cactus
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridCactusDeviceInfoSpec.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#include <NitroModules/JHybridObject.hpp>
|
|
11
|
-
#include <fbjni/fbjni.h>
|
|
12
|
-
#include "HybridCactusDeviceInfoSpec.hpp"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
namespace margelo::nitro::cactus {
|
|
18
|
-
|
|
19
|
-
using namespace facebook;
|
|
20
|
-
|
|
21
|
-
class JHybridCactusDeviceInfoSpec: public jni::HybridClass<JHybridCactusDeviceInfoSpec, JHybridObject>,
|
|
22
|
-
public virtual HybridCactusDeviceInfoSpec {
|
|
23
|
-
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cactus/HybridCactusDeviceInfoSpec;";
|
|
25
|
-
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
|
-
static void registerNatives();
|
|
27
|
-
|
|
28
|
-
protected:
|
|
29
|
-
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
-
explicit JHybridCactusDeviceInfoSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
-
HybridObject(HybridCactusDeviceInfoSpec::TAG),
|
|
32
|
-
HybridBase(jThis),
|
|
33
|
-
_javaPart(jni::make_global(jThis)) {}
|
|
34
|
-
|
|
35
|
-
public:
|
|
36
|
-
~JHybridCactusDeviceInfoSpec() override {
|
|
37
|
-
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
|
-
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public:
|
|
42
|
-
size_t getExternalMemorySize() noexcept override;
|
|
43
|
-
void dispose() noexcept override;
|
|
44
|
-
std::string toString() override;
|
|
45
|
-
|
|
46
|
-
public:
|
|
47
|
-
inline const jni::global_ref<JHybridCactusDeviceInfoSpec::javaobject>& getJavaPart() const noexcept {
|
|
48
|
-
return _javaPart;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public:
|
|
52
|
-
// Properties
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
public:
|
|
56
|
-
// Methods
|
|
57
|
-
std::shared_ptr<Promise<std::optional<std::string>>> getAppIdentifier() override;
|
|
58
|
-
std::shared_ptr<Promise<DeviceInfo>> getDeviceInfo() override;
|
|
59
|
-
|
|
60
|
-
private:
|
|
61
|
-
friend HybridBase;
|
|
62
|
-
using HybridBase::HybridBase;
|
|
63
|
-
jni::global_ref<JHybridCactusDeviceInfoSpec::javaobject> _javaPart;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
} // namespace margelo::nitro::cactus
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// DeviceInfo.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.cactus
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Represents the JavaScript object/struct "DeviceInfo".
|
|
16
|
-
*/
|
|
17
|
-
@DoNotStrip
|
|
18
|
-
@Keep
|
|
19
|
-
data class DeviceInfo(
|
|
20
|
-
@DoNotStrip
|
|
21
|
-
@Keep
|
|
22
|
-
val brand: String,
|
|
23
|
-
@DoNotStrip
|
|
24
|
-
@Keep
|
|
25
|
-
val model: String,
|
|
26
|
-
@DoNotStrip
|
|
27
|
-
@Keep
|
|
28
|
-
val device_id: String?,
|
|
29
|
-
@DoNotStrip
|
|
30
|
-
@Keep
|
|
31
|
-
val os: String,
|
|
32
|
-
@DoNotStrip
|
|
33
|
-
@Keep
|
|
34
|
-
val os_version: String
|
|
35
|
-
) {
|
|
36
|
-
/* primary constructor */
|
|
37
|
-
|
|
38
|
-
private companion object {
|
|
39
|
-
/**
|
|
40
|
-
* Constructor called from C++
|
|
41
|
-
*/
|
|
42
|
-
@DoNotStrip
|
|
43
|
-
@Keep
|
|
44
|
-
@Suppress("unused")
|
|
45
|
-
@JvmStatic
|
|
46
|
-
private fun fromCpp(brand: String, model: String, device_id: String?, os: String, os_version: String): DeviceInfo {
|
|
47
|
-
return DeviceInfo(brand, model, device_id, os, os_version)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusCryptoSpec.kt
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridCactusCryptoSpec.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.cactus
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.jni.HybridData
|
|
12
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
-
import com.margelo.nitro.core.Promise
|
|
14
|
-
import com.margelo.nitro.core.HybridObject
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A Kotlin class representing the CactusCrypto HybridObject.
|
|
18
|
-
* Implement this abstract class to create Kotlin-based instances of CactusCrypto.
|
|
19
|
-
*/
|
|
20
|
-
@DoNotStrip
|
|
21
|
-
@Keep
|
|
22
|
-
@Suppress(
|
|
23
|
-
"KotlinJniMissingFunction", "unused",
|
|
24
|
-
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
-
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
-
)
|
|
27
|
-
abstract class HybridCactusCryptoSpec: HybridObject() {
|
|
28
|
-
@DoNotStrip
|
|
29
|
-
private var mHybridData: HybridData = initHybrid()
|
|
30
|
-
|
|
31
|
-
init {
|
|
32
|
-
super.updateNative(mHybridData)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
override fun updateNative(hybridData: HybridData) {
|
|
36
|
-
mHybridData = hybridData
|
|
37
|
-
super.updateNative(hybridData)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Default implementation of `HybridObject.toString()`
|
|
41
|
-
override fun toString(): String {
|
|
42
|
-
return "[HybridObject CactusCrypto]"
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Properties
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Methods
|
|
49
|
-
@DoNotStrip
|
|
50
|
-
@Keep
|
|
51
|
-
abstract fun uuidv5(namespaceUuid: String, name: String): Promise<String>
|
|
52
|
-
|
|
53
|
-
private external fun initHybrid(): HybridData
|
|
54
|
-
|
|
55
|
-
companion object {
|
|
56
|
-
protected const val TAG = "HybridCactusCryptoSpec"
|
|
57
|
-
}
|
|
58
|
-
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusDeviceInfoSpec.kt
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridCactusDeviceInfoSpec.kt
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
package com.margelo.nitro.cactus
|
|
9
|
-
|
|
10
|
-
import androidx.annotation.Keep
|
|
11
|
-
import com.facebook.jni.HybridData
|
|
12
|
-
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
-
import com.margelo.nitro.core.Promise
|
|
14
|
-
import com.margelo.nitro.core.HybridObject
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A Kotlin class representing the CactusDeviceInfo HybridObject.
|
|
18
|
-
* Implement this abstract class to create Kotlin-based instances of CactusDeviceInfo.
|
|
19
|
-
*/
|
|
20
|
-
@DoNotStrip
|
|
21
|
-
@Keep
|
|
22
|
-
@Suppress(
|
|
23
|
-
"KotlinJniMissingFunction", "unused",
|
|
24
|
-
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
-
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
-
)
|
|
27
|
-
abstract class HybridCactusDeviceInfoSpec: HybridObject() {
|
|
28
|
-
@DoNotStrip
|
|
29
|
-
private var mHybridData: HybridData = initHybrid()
|
|
30
|
-
|
|
31
|
-
init {
|
|
32
|
-
super.updateNative(mHybridData)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
override fun updateNative(hybridData: HybridData) {
|
|
36
|
-
mHybridData = hybridData
|
|
37
|
-
super.updateNative(hybridData)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Default implementation of `HybridObject.toString()`
|
|
41
|
-
override fun toString(): String {
|
|
42
|
-
return "[HybridObject CactusDeviceInfo]"
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Properties
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Methods
|
|
49
|
-
@DoNotStrip
|
|
50
|
-
@Keep
|
|
51
|
-
abstract fun getAppIdentifier(): Promise<String?>
|
|
52
|
-
|
|
53
|
-
@DoNotStrip
|
|
54
|
-
@Keep
|
|
55
|
-
abstract fun getDeviceInfo(): Promise<DeviceInfo>
|
|
56
|
-
|
|
57
|
-
private external fun initHybrid(): HybridData
|
|
58
|
-
|
|
59
|
-
companion object {
|
|
60
|
-
protected const val TAG = "HybridCactusDeviceInfoSpec"
|
|
61
|
-
}
|
|
62
|
-
}
|