react-native-candle 0.1.5 → 0.1.6
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/ReactNativeCandle.podspec +37 -4
- package/ios/Sources/CandleLinkSheetWrapperView.swift +22 -3
- package/ios/Sources/CandleLinkViewModel.swift +1 -23
- package/ios/Sources/RNCandle.swift +44 -6
- package/lib/commonjs/index.js +13 -13
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +13 -11
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +4 -6
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +16 -3
- package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +4 -6
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +16 -3
- package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -1
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +109 -13
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +10 -0
- package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +14 -4
- package/nitrogen/generated/ios/swift/Details.swift +105 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_LinkedAccount_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +3 -3
- package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +31 -12
- package/nitrogen/generated/ios/swift/LinkedAccount.swift +86 -0
- package/nitrogen/generated/ios/swift/Service.swift +4 -8
- package/nitrogen/generated/ios/swift/State.swift +38 -0
- package/nitrogen/generated/shared/c++/Details.hpp +84 -0
- package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +7 -3
- package/nitrogen/generated/shared/c++/LinkedAccount.hpp +87 -0
- package/nitrogen/generated/shared/c++/Service.hpp +4 -8
- package/nitrogen/generated/shared/c++/State.hpp +78 -0
- package/package.json +1 -1
- package/src/index.ts +14 -15
- package/src/specs/RNCandle.nitro.ts +20 -6
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Details.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
// Forward declaration of `State` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rncandle { enum class State; }
|
|
23
|
+
|
|
24
|
+
#include "State.hpp"
|
|
25
|
+
#include <optional>
|
|
26
|
+
#include <string>
|
|
27
|
+
|
|
28
|
+
namespace margelo::nitro::rncandle {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A struct which can be represented as a JavaScript object (Details).
|
|
32
|
+
*/
|
|
33
|
+
struct Details {
|
|
34
|
+
public:
|
|
35
|
+
State state SWIFT_PRIVATE;
|
|
36
|
+
std::optional<std::string> username SWIFT_PRIVATE;
|
|
37
|
+
std::string legalName SWIFT_PRIVATE;
|
|
38
|
+
std::optional<std::string> accountOpened SWIFT_PRIVATE;
|
|
39
|
+
|
|
40
|
+
public:
|
|
41
|
+
Details() = default;
|
|
42
|
+
explicit Details(State state, std::optional<std::string> username, std::string legalName, std::optional<std::string> accountOpened): state(state), username(username), legalName(legalName), accountOpened(accountOpened) {}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
} // namespace margelo::nitro::rncandle
|
|
46
|
+
|
|
47
|
+
namespace margelo::nitro {
|
|
48
|
+
|
|
49
|
+
using namespace margelo::nitro::rncandle;
|
|
50
|
+
|
|
51
|
+
// C++ Details <> JS Details (object)
|
|
52
|
+
template <>
|
|
53
|
+
struct JSIConverter<Details> final {
|
|
54
|
+
static inline Details fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
55
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
56
|
+
return Details(
|
|
57
|
+
JSIConverter<State>::fromJSI(runtime, obj.getProperty(runtime, "state")),
|
|
58
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "username")),
|
|
59
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "legalName")),
|
|
60
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "accountOpened"))
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const Details& arg) {
|
|
64
|
+
jsi::Object obj(runtime);
|
|
65
|
+
obj.setProperty(runtime, "state", JSIConverter<State>::toJSI(runtime, arg.state));
|
|
66
|
+
obj.setProperty(runtime, "username", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.username));
|
|
67
|
+
obj.setProperty(runtime, "legalName", JSIConverter<std::string>::toJSI(runtime, arg.legalName));
|
|
68
|
+
obj.setProperty(runtime, "accountOpened", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accountOpened));
|
|
69
|
+
return obj;
|
|
70
|
+
}
|
|
71
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
72
|
+
if (!value.isObject()) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
jsi::Object obj = value.getObject(runtime);
|
|
76
|
+
if (!JSIConverter<State>::canConvert(runtime, obj.getProperty(runtime, "state"))) return false;
|
|
77
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "username"))) return false;
|
|
78
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "legalName"))) return false;
|
|
79
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "accountOpened"))) return false;
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro
|
|
@@ -19,16 +19,20 @@ namespace margelo::nitro::rncandle { enum class Service; }
|
|
|
19
19
|
namespace margelo::nitro::rncandle { enum class PresentationBackground; }
|
|
20
20
|
// Forward declaration of `PresentationStyle` to properly resolve imports.
|
|
21
21
|
namespace margelo::nitro::rncandle { enum class PresentationStyle; }
|
|
22
|
+
// Forward declaration of `LinkedAccount` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::rncandle { struct LinkedAccount; }
|
|
22
24
|
// Forward declaration of `ToolCall` to properly resolve imports.
|
|
23
25
|
namespace margelo::nitro::rncandle { struct ToolCall; }
|
|
24
26
|
|
|
25
|
-
#include "Service.hpp"
|
|
26
27
|
#include <optional>
|
|
28
|
+
#include <vector>
|
|
29
|
+
#include "Service.hpp"
|
|
27
30
|
#include <string>
|
|
28
31
|
#include "PresentationBackground.hpp"
|
|
29
32
|
#include "PresentationStyle.hpp"
|
|
30
33
|
#include <functional>
|
|
31
34
|
#include <NitroModules/Promise.hpp>
|
|
35
|
+
#include "LinkedAccount.hpp"
|
|
32
36
|
#include "ToolCall.hpp"
|
|
33
37
|
|
|
34
38
|
namespace margelo::nitro::rncandle {
|
|
@@ -62,8 +66,8 @@ namespace margelo::nitro::rncandle {
|
|
|
62
66
|
|
|
63
67
|
public:
|
|
64
68
|
// Methods
|
|
65
|
-
virtual void candleLinkSheet(bool isPresented, Service
|
|
66
|
-
virtual std::shared_ptr<Promise<std::
|
|
69
|
+
virtual void candleLinkSheet(bool isPresented, const std::optional<std::vector<Service>>& services, double cornerRadius, const std::optional<std::string>& customerName, bool showDynamicLoading, PresentationBackground presentationBackground, PresentationStyle presentationStyle, const std::function<void(const std::string& /* account */)>& onSuccess) = 0;
|
|
70
|
+
virtual std::shared_ptr<Promise<std::vector<LinkedAccount>>> getLinkedAccounts() = 0;
|
|
67
71
|
virtual std::shared_ptr<Promise<void>> unlinkAccount(const std::string& linkedAccountID) = 0;
|
|
68
72
|
virtual std::shared_ptr<Promise<std::string>> getFiatAccounts() = 0;
|
|
69
73
|
virtual std::shared_ptr<Promise<std::string>> getActivity(const std::optional<std::string>& span) = 0;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// LinkedAccount.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
// Forward declaration of `Details` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::rncandle { struct Details; }
|
|
23
|
+
// Forward declaration of `Service` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::rncandle { enum class Service; }
|
|
25
|
+
|
|
26
|
+
#include <string>
|
|
27
|
+
#include <optional>
|
|
28
|
+
#include "Details.hpp"
|
|
29
|
+
#include "Service.hpp"
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::rncandle {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A struct which can be represented as a JavaScript object (LinkedAccount).
|
|
35
|
+
*/
|
|
36
|
+
struct LinkedAccount {
|
|
37
|
+
public:
|
|
38
|
+
std::string serviceUserID SWIFT_PRIVATE;
|
|
39
|
+
std::optional<Details> details SWIFT_PRIVATE;
|
|
40
|
+
std::string linkedAccountID SWIFT_PRIVATE;
|
|
41
|
+
Service service SWIFT_PRIVATE;
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
LinkedAccount() = default;
|
|
45
|
+
explicit LinkedAccount(std::string serviceUserID, std::optional<Details> details, std::string linkedAccountID, Service service): serviceUserID(serviceUserID), details(details), linkedAccountID(linkedAccountID), service(service) {}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
} // namespace margelo::nitro::rncandle
|
|
49
|
+
|
|
50
|
+
namespace margelo::nitro {
|
|
51
|
+
|
|
52
|
+
using namespace margelo::nitro::rncandle;
|
|
53
|
+
|
|
54
|
+
// C++ LinkedAccount <> JS LinkedAccount (object)
|
|
55
|
+
template <>
|
|
56
|
+
struct JSIConverter<LinkedAccount> final {
|
|
57
|
+
static inline LinkedAccount fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
58
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
59
|
+
return LinkedAccount(
|
|
60
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "serviceUserID")),
|
|
61
|
+
JSIConverter<std::optional<Details>>::fromJSI(runtime, obj.getProperty(runtime, "details")),
|
|
62
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "linkedAccountID")),
|
|
63
|
+
JSIConverter<Service>::fromJSI(runtime, obj.getProperty(runtime, "service"))
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const LinkedAccount& arg) {
|
|
67
|
+
jsi::Object obj(runtime);
|
|
68
|
+
obj.setProperty(runtime, "serviceUserID", JSIConverter<std::string>::toJSI(runtime, arg.serviceUserID));
|
|
69
|
+
obj.setProperty(runtime, "details", JSIConverter<std::optional<Details>>::toJSI(runtime, arg.details));
|
|
70
|
+
obj.setProperty(runtime, "linkedAccountID", JSIConverter<std::string>::toJSI(runtime, arg.linkedAccountID));
|
|
71
|
+
obj.setProperty(runtime, "service", JSIConverter<Service>::toJSI(runtime, arg.service));
|
|
72
|
+
return obj;
|
|
73
|
+
}
|
|
74
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
75
|
+
if (!value.isObject()) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
jsi::Object obj = value.getObject(runtime);
|
|
79
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "serviceUserID"))) return false;
|
|
80
|
+
if (!JSIConverter<std::optional<Details>>::canConvert(runtime, obj.getProperty(runtime, "details"))) return false;
|
|
81
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "linkedAccountID"))) return false;
|
|
82
|
+
if (!JSIConverter<Service>::canConvert(runtime, obj.getProperty(runtime, "service"))) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
} // namespace margelo::nitro
|
|
@@ -33,10 +33,9 @@ namespace margelo::nitro::rncandle {
|
|
|
33
33
|
CASH_APP SWIFT_NAME(cashApp) = 1,
|
|
34
34
|
VENMO SWIFT_NAME(venmo) = 2,
|
|
35
35
|
APPLE SWIFT_NAME(apple) = 3,
|
|
36
|
-
|
|
36
|
+
SANDBOX SWIFT_NAME(sandbox) = 4,
|
|
37
37
|
UBER SWIFT_NAME(uber) = 5,
|
|
38
38
|
LYFT SWIFT_NAME(lyft) = 6,
|
|
39
|
-
DEFAULT SWIFT_NAME(default) = 7,
|
|
40
39
|
} CLOSED_ENUM;
|
|
41
40
|
|
|
42
41
|
} // namespace margelo::nitro::rncandle
|
|
@@ -55,10 +54,9 @@ namespace margelo::nitro {
|
|
|
55
54
|
case hashString("cash_app"): return Service::CASH_APP;
|
|
56
55
|
case hashString("venmo"): return Service::VENMO;
|
|
57
56
|
case hashString("apple"): return Service::APPLE;
|
|
58
|
-
case hashString("
|
|
57
|
+
case hashString("sandbox"): return Service::SANDBOX;
|
|
59
58
|
case hashString("uber"): return Service::UBER;
|
|
60
59
|
case hashString("lyft"): return Service::LYFT;
|
|
61
|
-
case hashString("default"): return Service::DEFAULT;
|
|
62
60
|
default: [[unlikely]]
|
|
63
61
|
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum Service - invalid value!");
|
|
64
62
|
}
|
|
@@ -69,10 +67,9 @@ namespace margelo::nitro {
|
|
|
69
67
|
case Service::CASH_APP: return JSIConverter<std::string>::toJSI(runtime, "cash_app");
|
|
70
68
|
case Service::VENMO: return JSIConverter<std::string>::toJSI(runtime, "venmo");
|
|
71
69
|
case Service::APPLE: return JSIConverter<std::string>::toJSI(runtime, "apple");
|
|
72
|
-
case Service::
|
|
70
|
+
case Service::SANDBOX: return JSIConverter<std::string>::toJSI(runtime, "sandbox");
|
|
73
71
|
case Service::UBER: return JSIConverter<std::string>::toJSI(runtime, "uber");
|
|
74
72
|
case Service::LYFT: return JSIConverter<std::string>::toJSI(runtime, "lyft");
|
|
75
|
-
case Service::DEFAULT: return JSIConverter<std::string>::toJSI(runtime, "default");
|
|
76
73
|
default: [[unlikely]]
|
|
77
74
|
throw std::invalid_argument("Cannot convert Service to JS - invalid value: "
|
|
78
75
|
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
@@ -88,10 +85,9 @@ namespace margelo::nitro {
|
|
|
88
85
|
case hashString("cash_app"):
|
|
89
86
|
case hashString("venmo"):
|
|
90
87
|
case hashString("apple"):
|
|
91
|
-
case hashString("
|
|
88
|
+
case hashString("sandbox"):
|
|
92
89
|
case hashString("uber"):
|
|
93
90
|
case hashString("lyft"):
|
|
94
|
-
case hashString("default"):
|
|
95
91
|
return true;
|
|
96
92
|
default:
|
|
97
93
|
return false;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// State.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::rncandle {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (State).
|
|
30
|
+
*/
|
|
31
|
+
enum class State {
|
|
32
|
+
ACTIVE SWIFT_NAME(active) = 0,
|
|
33
|
+
INACTIVE SWIFT_NAME(inactive) = 1,
|
|
34
|
+
} CLOSED_ENUM;
|
|
35
|
+
|
|
36
|
+
} // namespace margelo::nitro::rncandle
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro {
|
|
39
|
+
|
|
40
|
+
using namespace margelo::nitro::rncandle;
|
|
41
|
+
|
|
42
|
+
// C++ State <> JS State (union)
|
|
43
|
+
template <>
|
|
44
|
+
struct JSIConverter<State> final {
|
|
45
|
+
static inline State fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
46
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
47
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
48
|
+
case hashString("active"): return State::ACTIVE;
|
|
49
|
+
case hashString("inactive"): return State::INACTIVE;
|
|
50
|
+
default: [[unlikely]]
|
|
51
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum State - invalid value!");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, State arg) {
|
|
55
|
+
switch (arg) {
|
|
56
|
+
case State::ACTIVE: return JSIConverter<std::string>::toJSI(runtime, "active");
|
|
57
|
+
case State::INACTIVE: return JSIConverter<std::string>::toJSI(runtime, "inactive");
|
|
58
|
+
default: [[unlikely]]
|
|
59
|
+
throw std::invalid_argument("Cannot convert State to JS - invalid value: "
|
|
60
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
64
|
+
if (!value.isString()) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
68
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
69
|
+
case hashString("active"):
|
|
70
|
+
case hashString("inactive"):
|
|
71
|
+
return true;
|
|
72
|
+
default:
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NitroModules } from "react-native-nitro-modules";
|
|
2
2
|
import type {
|
|
3
|
+
LinkedAccount,
|
|
3
4
|
PresentationBackground,
|
|
4
5
|
PresentationStyle,
|
|
5
6
|
RNCandle,
|
|
@@ -10,16 +11,15 @@ const CandleHybridObject =
|
|
|
10
11
|
NitroModules.createHybridObject<RNCandle>("RNCandle");
|
|
11
12
|
|
|
12
13
|
export function presentCandleLinkSheet({
|
|
13
|
-
|
|
14
|
+
services = undefined,
|
|
14
15
|
cornerRadius = 24,
|
|
15
16
|
customerName,
|
|
16
|
-
showSandbox = false,
|
|
17
17
|
showDynamicLoading = true,
|
|
18
18
|
presentationBackground = "default",
|
|
19
19
|
presentationStyle = "sheet",
|
|
20
20
|
onSuccess,
|
|
21
21
|
}: {
|
|
22
|
-
|
|
22
|
+
services?: Service[];
|
|
23
23
|
cornerRadius?: number;
|
|
24
24
|
customerName?: string;
|
|
25
25
|
showSandbox?: boolean;
|
|
@@ -30,10 +30,9 @@ export function presentCandleLinkSheet({
|
|
|
30
30
|
}): void {
|
|
31
31
|
CandleHybridObject.candleLinkSheet(
|
|
32
32
|
true,
|
|
33
|
-
|
|
33
|
+
services,
|
|
34
34
|
cornerRadius,
|
|
35
35
|
customerName,
|
|
36
|
-
showSandbox,
|
|
37
36
|
showDynamicLoading,
|
|
38
37
|
presentationBackground,
|
|
39
38
|
presentationStyle,
|
|
@@ -41,21 +40,21 @@ export function presentCandleLinkSheet({
|
|
|
41
40
|
);
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
export async function
|
|
45
|
-
await CandleHybridObject.unlinkAccount(linkedAccountID);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export async function getLinkedAccounts(): Promise<string> {
|
|
43
|
+
export async function getLinkedAccounts(): Promise<LinkedAccount[]> {
|
|
49
44
|
return await CandleHybridObject.getLinkedAccounts();
|
|
50
45
|
}
|
|
51
46
|
|
|
52
|
-
export async function
|
|
53
|
-
|
|
47
|
+
export async function unlinkAccount(linkedAccountID: string): Promise<void> {
|
|
48
|
+
await CandleHybridObject.unlinkAccount(linkedAccountID);
|
|
54
49
|
}
|
|
55
50
|
|
|
56
|
-
export async function
|
|
57
|
-
|
|
58
|
-
}
|
|
51
|
+
// export async function getFiatAccounts(): Promise<string> {
|
|
52
|
+
// return await CandleHybridObject.getFiatAccounts();
|
|
53
|
+
// }
|
|
54
|
+
|
|
55
|
+
// export async function getActivity(span?: string): Promise<string> {
|
|
56
|
+
// return await CandleHybridObject.getActivity(span);
|
|
57
|
+
// }
|
|
59
58
|
|
|
60
59
|
export async function deleteUser(): Promise<void> {
|
|
61
60
|
await CandleHybridObject.deleteUser();
|
|
@@ -5,14 +5,29 @@ export type Service =
|
|
|
5
5
|
| "cash_app"
|
|
6
6
|
| "venmo"
|
|
7
7
|
| "apple"
|
|
8
|
-
| "
|
|
8
|
+
| "sandbox"
|
|
9
9
|
| "uber"
|
|
10
|
-
| "lyft"
|
|
11
|
-
| "default";
|
|
10
|
+
| "lyft";
|
|
12
11
|
|
|
13
12
|
export type PresentationBackground = "default" | "blur";
|
|
14
13
|
export type PresentationStyle = "sheet" | "fullScreen";
|
|
15
14
|
|
|
15
|
+
export type State = "active" | "inactive";
|
|
16
|
+
|
|
17
|
+
export type Details = {
|
|
18
|
+
state: State;
|
|
19
|
+
username: string | undefined;
|
|
20
|
+
legalName: string;
|
|
21
|
+
accountOpened: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export interface LinkedAccount {
|
|
25
|
+
serviceUserID: string;
|
|
26
|
+
details: Details | undefined;
|
|
27
|
+
linkedAccountID: string;
|
|
28
|
+
service: Service;
|
|
29
|
+
}
|
|
30
|
+
|
|
16
31
|
export type ToolCall = {
|
|
17
32
|
name: string;
|
|
18
33
|
arguments: string;
|
|
@@ -21,16 +36,15 @@ export type ToolCall = {
|
|
|
21
36
|
export interface RNCandle extends HybridObject<{ ios: "swift" }> {
|
|
22
37
|
candleLinkSheet(
|
|
23
38
|
isPresented: boolean,
|
|
24
|
-
|
|
39
|
+
services: Service[] | undefined,
|
|
25
40
|
cornerRadius: number,
|
|
26
41
|
customerName: string | undefined,
|
|
27
|
-
showSandbox: boolean,
|
|
28
42
|
showDynamicLoading: boolean,
|
|
29
43
|
presentationBackground: PresentationBackground,
|
|
30
44
|
presentationStyle: PresentationStyle,
|
|
31
45
|
onSuccess: (account: string) => void
|
|
32
46
|
): void;
|
|
33
|
-
getLinkedAccounts(): Promise<
|
|
47
|
+
getLinkedAccounts(): Promise<LinkedAccount[]>;
|
|
34
48
|
unlinkAccount(linkedAccountID: string): Promise<void>;
|
|
35
49
|
getFiatAccounts(): Promise<string>;
|
|
36
50
|
getActivity(span: string | undefined): Promise<string>;
|