react-native-candle 0.1.11 → 0.1.13
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 +1 -1
- package/ios/Sources/CandleLinkSheetWrapperView.swift +179 -38
- package/ios/Sources/CandleLinkViewModel.swift +3 -11
- package/ios/Sources/RNCandle.swift +300 -100
- package/ios/Sources/UIApplication++.swift +0 -1
- package/lib/commonjs/index.js +33 -41
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +31 -35
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +23 -19
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts +11 -6
- package/lib/typescript/commonjs/src/specs/RNCandle.nitro.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +23 -19
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts +11 -6
- package/lib/typescript/module/src/specs/RNCandle.nitro.d.ts.map +1 -1
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.cpp +20 -4
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Bridge.hpp +99 -20
- package/nitrogen/generated/ios/ReactNativeCandle-Swift-Cxx-Umbrella.hpp +6 -0
- package/nitrogen/generated/ios/c++/HybridRNCandleSpecSwift.hpp +15 -3
- package/nitrogen/generated/ios/swift/AppUser.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void_LinkedAccount.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_AnyMap__.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridRNCandleSpec.swift +4 -2
- package/nitrogen/generated/ios/swift/HybridRNCandleSpec_cxx.swift +40 -12
- package/nitrogen/generated/ios/swift/Service.swift +292 -0
- package/nitrogen/generated/shared/c++/AppUser.hpp +73 -0
- package/nitrogen/generated/shared/c++/HybridRNCandleSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridRNCandleSpec.hpp +10 -3
- package/nitrogen/generated/shared/c++/Service.hpp +292 -0
- package/package.json +1 -1
- package/src/index.ts +55 -55
- package/src/specs/RNCandle.nitro.ts +85 -6
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import type { LinkedAccount, PresentationBackground,
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
customerName
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import type { AppUser, LinkedAccount, PresentationBackground, Service } from "./specs/RNCandle.nitro";
|
|
2
|
+
export declare class CandleClient {
|
|
3
|
+
private candle;
|
|
4
|
+
constructor(appUser: AppUser);
|
|
5
|
+
presentCandleLinkSheet({ services, cornerRadius, customerName, showDynamicLoading, presentationBackground, onSuccess, }: {
|
|
6
|
+
services?: Service[];
|
|
7
|
+
cornerRadius?: number;
|
|
8
|
+
customerName?: string;
|
|
9
|
+
showSandbox?: boolean;
|
|
10
|
+
showDynamicLoading?: boolean;
|
|
11
|
+
presentationBackground?: PresentationBackground;
|
|
12
|
+
onSuccess: (account: LinkedAccount) => void;
|
|
13
|
+
}): void;
|
|
14
|
+
getLinkedAccounts(): Promise<LinkedAccount[]>;
|
|
15
|
+
unlinkAccount(linkedAccountID: string): Promise<void>;
|
|
16
|
+
deleteUser(): Promise<void>;
|
|
17
|
+
getAvailableTools(): Promise<Array<Record<string, any>>>;
|
|
18
|
+
executeTool(tool: {
|
|
19
|
+
name: string;
|
|
20
|
+
arguments: string;
|
|
21
|
+
}): Promise<string>;
|
|
22
|
+
}
|
|
23
|
+
export type { LinkedAccount, AppUser };
|
|
20
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,sBAAsB,EAEtB,OAAO,EACR,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAW;gBAEb,OAAO,EAAE,OAAO;IAOrB,sBAAsB,CAAC,EAC5B,QAAoB,EACpB,YAAiB,EACjB,YAAY,EACZ,kBAAyB,EACzB,sBAAkC,EAClC,SAAS,GACV,EAAE;QACD,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;QAChD,SAAS,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;KAC7C,GAAG,IAAI;IAaK,iBAAiB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAI7C,aAAa,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,iBAAiB,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAIxD,WAAW,CAAC,IAAI,EAAE;QAC7B,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,MAAM,CAAC;CAGpB;AAED,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type { HybridObject } from "react-native-nitro-modules";
|
|
2
|
-
export type
|
|
1
|
+
import type { AnyMap, HybridObject } from "react-native-nitro-modules";
|
|
2
|
+
export type AppUser = {
|
|
3
|
+
appKey: string;
|
|
4
|
+
appSecret: string;
|
|
5
|
+
};
|
|
6
|
+
export type Service = "robinhood" | "cash_app" | "venmo" | "apple" | "sandbox" | "uber" | "lyft" | "chime" | "paypal" | "coinbase" | "discover" | "american_express" | "jpmorgan_chase" | "bank_of_america" | "capital_one" | "citibank" | "vanguard" | "wells_fargo" | "charles_schwab" | "kalshi" | "experian" | "waymo" | "revel" | "turo" | "getaround" | "zipcar" | "airbnb" | "american_airlines" | "delta" | "united" | "jetblue" | "southwest" | "hawaiian" | "hotels" | "geico" | "progressive" | "aaa" | "state_farm" | "hertz" | "avis" | "tesla" | "doordash" | "uber_eats" | "grubhub" | "resy" | "opentable" | "starbucks" | "blue_bottle" | "costco" | "amazon" | "walmart" | "whole_foods" | "mcdonalds" | "chipotle" | "sweetgreen" | "snapchat" | "x" | "facebook" | "instagram" | "signal" | "whatsapp" | "messenger" | "linkedin" | "discord" | "messages" | "telegram" | "reddit" | "pinterest" | "new_york_times" | "washington_post" | "wall_street_journal" | "cnn" | "yahoo" | "fox" | "perplexity" | "openai" | "polymarket" | "espn" | "youtube" | "netflix";
|
|
3
7
|
export type PresentationBackground = "default" | "blur";
|
|
4
8
|
export type PresentationStyle = "sheet" | "fullScreen";
|
|
5
9
|
export type State = "active" | "inactive";
|
|
@@ -9,12 +13,12 @@ export type Details = {
|
|
|
9
13
|
legalName: string;
|
|
10
14
|
accountOpened: string | undefined;
|
|
11
15
|
};
|
|
12
|
-
export
|
|
16
|
+
export type LinkedAccount = {
|
|
13
17
|
serviceUserID: string;
|
|
14
18
|
details: Details | undefined;
|
|
15
19
|
linkedAccountID: string;
|
|
16
20
|
service: Service;
|
|
17
|
-
}
|
|
21
|
+
};
|
|
18
22
|
export type ToolCall = {
|
|
19
23
|
name: string;
|
|
20
24
|
arguments: string;
|
|
@@ -22,13 +26,14 @@ export type ToolCall = {
|
|
|
22
26
|
export interface RNCandle extends HybridObject<{
|
|
23
27
|
ios: "swift";
|
|
24
28
|
}> {
|
|
25
|
-
candleLinkSheet(isPresented: boolean, services: Service[] | undefined, cornerRadius: number, customerName: string | undefined, showDynamicLoading: boolean, presentationBackground: PresentationBackground, presentationStyle: PresentationStyle, onSuccess: (account:
|
|
29
|
+
candleLinkSheet(isPresented: boolean, services: Service[] | undefined, cornerRadius: number, customerName: string | undefined, showDynamicLoading: boolean, presentationBackground: PresentationBackground, presentationStyle: PresentationStyle, onSuccess: (account: LinkedAccount) => void): void;
|
|
30
|
+
initialize(appUser: AppUser): void;
|
|
26
31
|
getLinkedAccounts(): Promise<LinkedAccount[]>;
|
|
27
32
|
unlinkAccount(linkedAccountID: string): Promise<void>;
|
|
28
33
|
getFiatAccounts(): Promise<string>;
|
|
29
34
|
getActivity(span: string | undefined): Promise<string>;
|
|
30
35
|
deleteUser(): Promise<void>;
|
|
31
|
-
getAvailableTools(): Promise<
|
|
36
|
+
getAvailableTools(): Promise<Array<AnyMap>>;
|
|
32
37
|
executeTool(tool: ToolCall): Promise<string>;
|
|
33
38
|
}
|
|
34
39
|
//# sourceMappingURL=RNCandle.nitro.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RNCandle.nitro.d.ts","sourceRoot":"","sources":["../../../../../src/specs/RNCandle.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"RNCandle.nitro.d.ts","sourceRoot":"","sources":["../../../../../src/specs/RNCandle.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEvE,MAAM,MAAM,OAAO,GAAG;IACpB,MA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AC5C,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9C"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import type { LinkedAccount, PresentationBackground,
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
customerName
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import type { AppUser, LinkedAccount, PresentationBackground, Service } from "./specs/RNCandle.nitro";
|
|
2
|
+
export declare class CandleClient {
|
|
3
|
+
private candle;
|
|
4
|
+
constructor(appUser: AppUser);
|
|
5
|
+
presentCandleLinkSheet({ services, cornerRadius, customerName, showDynamicLoading, presentationBackground, onSuccess, }: {
|
|
6
|
+
services?: Service[];
|
|
7
|
+
cornerRadius?: number;
|
|
8
|
+
customerName?: string;
|
|
9
|
+
showSandbox?: boolean;
|
|
10
|
+
showDynamicLoading?: boolean;
|
|
11
|
+
presentationBackground?: PresentationBackground;
|
|
12
|
+
onSuccess: (account: LinkedAccount) => void;
|
|
13
|
+
}): void;
|
|
14
|
+
getLinkedAccounts(): Promise<LinkedAccount[]>;
|
|
15
|
+
unlinkAccount(linkedAccountID: string): Promise<void>;
|
|
16
|
+
deleteUser(): Promise<void>;
|
|
17
|
+
getAvailableTools(): Promise<Array<Record<string, any>>>;
|
|
18
|
+
executeTool(tool: {
|
|
19
|
+
name: string;
|
|
20
|
+
arguments: string;
|
|
21
|
+
}): Promise<string>;
|
|
22
|
+
}
|
|
23
|
+
export type { LinkedAccount, AppUser };
|
|
20
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,sBAAsB,EAEtB,OAAO,EACR,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAW;gBAEb,OAAO,EAAE,OAAO;IAOrB,sBAAsB,CAAC,EAC5B,QAAoB,EACpB,YAAiB,EACjB,YAAY,EACZ,kBAAyB,EACzB,sBAAkC,EAClC,SAAS,GACV,EAAE;QACD,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;QAChD,SAAS,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;KAC7C,GAAG,IAAI;IAaK,iBAAiB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAI7C,aAAa,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,iBAAiB,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAIxD,WAAW,CAAC,IAAI,EAAE;QAC7B,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,MAAM,CAAC;CAGpB;AAED,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type { HybridObject } from "react-native-nitro-modules";
|
|
2
|
-
export type
|
|
1
|
+
import type { AnyMap, HybridObject } from "react-native-nitro-modules";
|
|
2
|
+
export type AppUser = {
|
|
3
|
+
appKey: string;
|
|
4
|
+
appSecret: string;
|
|
5
|
+
};
|
|
6
|
+
export type Service = "robinhood" | "cash_app" | "venmo" | "apple" | "sandbox" | "uber" | "lyft" | "chime" | "paypal" | "coinbase" | "discover" | "american_express" | "jpmorgan_chase" | "bank_of_america" | "capital_one" | "citibank" | "vanguard" | "wells_fargo" | "charles_schwab" | "kalshi" | "experian" | "waymo" | "revel" | "turo" | "getaround" | "zipcar" | "airbnb" | "american_airlines" | "delta" | "united" | "jetblue" | "southwest" | "hawaiian" | "hotels" | "geico" | "progressive" | "aaa" | "state_farm" | "hertz" | "avis" | "tesla" | "doordash" | "uber_eats" | "grubhub" | "resy" | "opentable" | "starbucks" | "blue_bottle" | "costco" | "amazon" | "walmart" | "whole_foods" | "mcdonalds" | "chipotle" | "sweetgreen" | "snapchat" | "x" | "facebook" | "instagram" | "signal" | "whatsapp" | "messenger" | "linkedin" | "discord" | "messages" | "telegram" | "reddit" | "pinterest" | "new_york_times" | "washington_post" | "wall_street_journal" | "cnn" | "yahoo" | "fox" | "perplexity" | "openai" | "polymarket" | "espn" | "youtube" | "netflix";
|
|
3
7
|
export type PresentationBackground = "default" | "blur";
|
|
4
8
|
export type PresentationStyle = "sheet" | "fullScreen";
|
|
5
9
|
export type State = "active" | "inactive";
|
|
@@ -9,12 +13,12 @@ export type Details = {
|
|
|
9
13
|
legalName: string;
|
|
10
14
|
accountOpened: string | undefined;
|
|
11
15
|
};
|
|
12
|
-
export
|
|
16
|
+
export type LinkedAccount = {
|
|
13
17
|
serviceUserID: string;
|
|
14
18
|
details: Details | undefined;
|
|
15
19
|
linkedAccountID: string;
|
|
16
20
|
service: Service;
|
|
17
|
-
}
|
|
21
|
+
};
|
|
18
22
|
export type ToolCall = {
|
|
19
23
|
name: string;
|
|
20
24
|
arguments: string;
|
|
@@ -22,13 +26,14 @@ export type ToolCall = {
|
|
|
22
26
|
export interface RNCandle extends HybridObject<{
|
|
23
27
|
ios: "swift";
|
|
24
28
|
}> {
|
|
25
|
-
candleLinkSheet(isPresented: boolean, services: Service[] | undefined, cornerRadius: number, customerName: string | undefined, showDynamicLoading: boolean, presentationBackground: PresentationBackground, presentationStyle: PresentationStyle, onSuccess: (account:
|
|
29
|
+
candleLinkSheet(isPresented: boolean, services: Service[] | undefined, cornerRadius: number, customerName: string | undefined, showDynamicLoading: boolean, presentationBackground: PresentationBackground, presentationStyle: PresentationStyle, onSuccess: (account: LinkedAccount) => void): void;
|
|
30
|
+
initialize(appUser: AppUser): void;
|
|
26
31
|
getLinkedAccounts(): Promise<LinkedAccount[]>;
|
|
27
32
|
unlinkAccount(linkedAccountID: string): Promise<void>;
|
|
28
33
|
getFiatAccounts(): Promise<string>;
|
|
29
34
|
getActivity(span: string | undefined): Promise<string>;
|
|
30
35
|
deleteUser(): Promise<void>;
|
|
31
|
-
getAvailableTools(): Promise<
|
|
36
|
+
getAvailableTools(): Promise<Array<AnyMap>>;
|
|
32
37
|
executeTool(tool: ToolCall): Promise<string>;
|
|
33
38
|
}
|
|
34
39
|
//# sourceMappingURL=RNCandle.nitro.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RNCandle.nitro.d.ts","sourceRoot":"","sources":["../../../../../src/specs/RNCandle.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"RNCandle.nitro.d.ts","sourceRoot":"","sources":["../../../../../src/specs/RNCandle.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEvE,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,OAAO,GACf,WAAW,GACX,UAAU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|
|
|
13
13
|
|
|
14
14
|
namespace margelo::nitro::rncandle::bridge::swift {
|
|
15
15
|
|
|
16
|
-
// pragma MARK: std::function<void(const
|
|
17
|
-
|
|
18
|
-
auto swiftClosure = ReactNativeCandle::
|
|
19
|
-
return [swiftClosure = std::move(swiftClosure)](const
|
|
16
|
+
// pragma MARK: std::function<void(const LinkedAccount& /* account */)>
|
|
17
|
+
Func_void_LinkedAccount create_Func_void_LinkedAccount(void* _Nonnull swiftClosureWrapper) {
|
|
18
|
+
auto swiftClosure = ReactNativeCandle::Func_void_LinkedAccount::fromUnsafe(swiftClosureWrapper);
|
|
19
|
+
return [swiftClosure = std::move(swiftClosure)](const LinkedAccount& account) mutable -> void {
|
|
20
20
|
swiftClosure.call(account);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
@@ -45,6 +45,22 @@ namespace margelo::nitro::rncandle::bridge::swift {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
49
|
+
Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper) {
|
|
50
|
+
auto swiftClosure = ReactNativeCandle::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
|
|
51
|
+
return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void {
|
|
52
|
+
swiftClosure.call(result);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// pragma MARK: std::function<void(const std::vector<std::shared_ptr<AnyMap>>& /* result */)>
|
|
57
|
+
Func_void_std__vector_std__shared_ptr_AnyMap__ create_Func_void_std__vector_std__shared_ptr_AnyMap__(void* _Nonnull swiftClosureWrapper) {
|
|
58
|
+
auto swiftClosure = ReactNativeCandle::Func_void_std__vector_std__shared_ptr_AnyMap__::fromUnsafe(swiftClosureWrapper);
|
|
59
|
+
return [swiftClosure = std::move(swiftClosure)](const std::vector<std::shared_ptr<AnyMap>>& result) mutable -> void {
|
|
60
|
+
swiftClosure.call(result);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
48
64
|
// pragma MARK: std::shared_ptr<margelo::nitro::rncandle::HybridRNCandleSpec>
|
|
49
65
|
std::shared_ptr<margelo::nitro::rncandle::HybridRNCandleSpec> create_std__shared_ptr_margelo__nitro__rncandle__HybridRNCandleSpec_(void* _Nonnull swiftUnsafePointer) {
|
|
50
66
|
ReactNativeCandle::HybridRNCandleSpec_cxx swiftPart = ReactNativeCandle::HybridRNCandleSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
12
|
+
namespace NitroModules { class AnyMap; }
|
|
11
13
|
// Forward declaration of `Details` to properly resolve imports.
|
|
12
14
|
namespace margelo::nitro::rncandle { struct Details; }
|
|
13
15
|
// Forward declaration of `HybridRNCandleSpec` to properly resolve imports.
|
|
@@ -29,6 +31,7 @@ namespace ReactNativeCandle { class HybridRNCandleSpec_cxx; }
|
|
|
29
31
|
#include "LinkedAccount.hpp"
|
|
30
32
|
#include "Service.hpp"
|
|
31
33
|
#include "State.hpp"
|
|
34
|
+
#include <NitroModules/AnyMap.hpp>
|
|
32
35
|
#include <NitroModules/Promise.hpp>
|
|
33
36
|
#include <NitroModules/PromiseHolder.hpp>
|
|
34
37
|
#include <NitroModules/Result.hpp>
|
|
@@ -74,35 +77,35 @@ namespace margelo::nitro::rncandle::bridge::swift {
|
|
|
74
77
|
return std::optional<std::string>(value);
|
|
75
78
|
}
|
|
76
79
|
|
|
77
|
-
// pragma MARK: std::
|
|
80
|
+
// pragma MARK: std::optional<Details>
|
|
78
81
|
/**
|
|
79
|
-
* Specialized version of `std::
|
|
82
|
+
* Specialized version of `std::optional<Details>`.
|
|
83
|
+
*/
|
|
84
|
+
using std__optional_Details_ = std::optional<Details>;
|
|
85
|
+
inline std::optional<Details> create_std__optional_Details_(const Details& value) {
|
|
86
|
+
return std::optional<Details>(value);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// pragma MARK: std::function<void(const LinkedAccount& /* account */)>
|
|
90
|
+
/**
|
|
91
|
+
* Specialized version of `std::function<void(const LinkedAccount&)>`.
|
|
80
92
|
*/
|
|
81
|
-
using
|
|
93
|
+
using Func_void_LinkedAccount = std::function<void(const LinkedAccount& /* account */)>;
|
|
82
94
|
/**
|
|
83
|
-
* Wrapper class for a `std::function<void(const
|
|
95
|
+
* Wrapper class for a `std::function<void(const LinkedAccount& / * account * /)>`, this can be used from Swift.
|
|
84
96
|
*/
|
|
85
|
-
class
|
|
97
|
+
class Func_void_LinkedAccount_Wrapper final {
|
|
86
98
|
public:
|
|
87
|
-
explicit
|
|
88
|
-
inline void call(
|
|
99
|
+
explicit Func_void_LinkedAccount_Wrapper(std::function<void(const LinkedAccount& /* account */)>&& func): _function(std::make_shared<std::function<void(const LinkedAccount& /* account */)>>(std::move(func))) {}
|
|
100
|
+
inline void call(LinkedAccount account) const {
|
|
89
101
|
_function->operator()(account);
|
|
90
102
|
}
|
|
91
103
|
private:
|
|
92
|
-
std::shared_ptr<std::function<void(const
|
|
104
|
+
std::shared_ptr<std::function<void(const LinkedAccount& /* account */)>> _function;
|
|
93
105
|
};
|
|
94
|
-
|
|
95
|
-
inline
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// pragma MARK: std::optional<Details>
|
|
100
|
-
/**
|
|
101
|
-
* Specialized version of `std::optional<Details>`.
|
|
102
|
-
*/
|
|
103
|
-
using std__optional_Details_ = std::optional<Details>;
|
|
104
|
-
inline std::optional<Details> create_std__optional_Details_(const Details& value) {
|
|
105
|
-
return std::optional<Details>(value);
|
|
106
|
+
Func_void_LinkedAccount create_Func_void_LinkedAccount(void* _Nonnull swiftClosureWrapper);
|
|
107
|
+
inline Func_void_LinkedAccount_Wrapper wrap_Func_void_LinkedAccount(Func_void_LinkedAccount value) {
|
|
108
|
+
return Func_void_LinkedAccount_Wrapper(std::move(value));
|
|
106
109
|
}
|
|
107
110
|
|
|
108
111
|
// pragma MARK: std::vector<LinkedAccount>
|
|
@@ -218,6 +221,73 @@ namespace margelo::nitro::rncandle::bridge::swift {
|
|
|
218
221
|
return PromiseHolder<std::string>(std::move(promise));
|
|
219
222
|
}
|
|
220
223
|
|
|
224
|
+
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
225
|
+
/**
|
|
226
|
+
* Specialized version of `std::function<void(const std::string&)>`.
|
|
227
|
+
*/
|
|
228
|
+
using Func_void_std__string = std::function<void(const std::string& /* result */)>;
|
|
229
|
+
/**
|
|
230
|
+
* Wrapper class for a `std::function<void(const std::string& / * result * /)>`, this can be used from Swift.
|
|
231
|
+
*/
|
|
232
|
+
class Func_void_std__string_Wrapper final {
|
|
233
|
+
public:
|
|
234
|
+
explicit Func_void_std__string_Wrapper(std::function<void(const std::string& /* result */)>&& func): _function(std::make_shared<std::function<void(const std::string& /* result */)>>(std::move(func))) {}
|
|
235
|
+
inline void call(std::string result) const {
|
|
236
|
+
_function->operator()(result);
|
|
237
|
+
}
|
|
238
|
+
private:
|
|
239
|
+
std::shared_ptr<std::function<void(const std::string& /* result */)>> _function;
|
|
240
|
+
};
|
|
241
|
+
Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper);
|
|
242
|
+
inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) {
|
|
243
|
+
return Func_void_std__string_Wrapper(std::move(value));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// pragma MARK: std::vector<std::shared_ptr<AnyMap>>
|
|
247
|
+
/**
|
|
248
|
+
* Specialized version of `std::vector<std::shared_ptr<AnyMap>>`.
|
|
249
|
+
*/
|
|
250
|
+
using std__vector_std__shared_ptr_AnyMap__ = std::vector<std::shared_ptr<AnyMap>>;
|
|
251
|
+
inline std::vector<std::shared_ptr<AnyMap>> create_std__vector_std__shared_ptr_AnyMap__(size_t size) {
|
|
252
|
+
std::vector<std::shared_ptr<AnyMap>> vector;
|
|
253
|
+
vector.reserve(size);
|
|
254
|
+
return vector;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// pragma MARK: std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>>
|
|
258
|
+
/**
|
|
259
|
+
* Specialized version of `std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>>`.
|
|
260
|
+
*/
|
|
261
|
+
using std__shared_ptr_Promise_std__vector_std__shared_ptr_AnyMap____ = std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>>;
|
|
262
|
+
inline std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>> create_std__shared_ptr_Promise_std__vector_std__shared_ptr_AnyMap____() {
|
|
263
|
+
return Promise<std::vector<std::shared_ptr<AnyMap>>>::create();
|
|
264
|
+
}
|
|
265
|
+
inline PromiseHolder<std::vector<std::shared_ptr<AnyMap>>> wrap_std__shared_ptr_Promise_std__vector_std__shared_ptr_AnyMap____(std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>> promise) {
|
|
266
|
+
return PromiseHolder<std::vector<std::shared_ptr<AnyMap>>>(std::move(promise));
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// pragma MARK: std::function<void(const std::vector<std::shared_ptr<AnyMap>>& /* result */)>
|
|
270
|
+
/**
|
|
271
|
+
* Specialized version of `std::function<void(const std::vector<std::shared_ptr<AnyMap>>&)>`.
|
|
272
|
+
*/
|
|
273
|
+
using Func_void_std__vector_std__shared_ptr_AnyMap__ = std::function<void(const std::vector<std::shared_ptr<AnyMap>>& /* result */)>;
|
|
274
|
+
/**
|
|
275
|
+
* Wrapper class for a `std::function<void(const std::vector<std::shared_ptr<AnyMap>>& / * result * /)>`, this can be used from Swift.
|
|
276
|
+
*/
|
|
277
|
+
class Func_void_std__vector_std__shared_ptr_AnyMap___Wrapper final {
|
|
278
|
+
public:
|
|
279
|
+
explicit Func_void_std__vector_std__shared_ptr_AnyMap___Wrapper(std::function<void(const std::vector<std::shared_ptr<AnyMap>>& /* result */)>&& func): _function(std::make_shared<std::function<void(const std::vector<std::shared_ptr<AnyMap>>& /* result */)>>(std::move(func))) {}
|
|
280
|
+
inline void call(std::vector<std::shared_ptr<AnyMap>> result) const {
|
|
281
|
+
_function->operator()(result);
|
|
282
|
+
}
|
|
283
|
+
private:
|
|
284
|
+
std::shared_ptr<std::function<void(const std::vector<std::shared_ptr<AnyMap>>& /* result */)>> _function;
|
|
285
|
+
};
|
|
286
|
+
Func_void_std__vector_std__shared_ptr_AnyMap__ create_Func_void_std__vector_std__shared_ptr_AnyMap__(void* _Nonnull swiftClosureWrapper);
|
|
287
|
+
inline Func_void_std__vector_std__shared_ptr_AnyMap___Wrapper wrap_Func_void_std__vector_std__shared_ptr_AnyMap__(Func_void_std__vector_std__shared_ptr_AnyMap__ value) {
|
|
288
|
+
return Func_void_std__vector_std__shared_ptr_AnyMap___Wrapper(std::move(value));
|
|
289
|
+
}
|
|
290
|
+
|
|
221
291
|
// pragma MARK: std::shared_ptr<margelo::nitro::rncandle::HybridRNCandleSpec>
|
|
222
292
|
/**
|
|
223
293
|
* Specialized version of `std::shared_ptr<margelo::nitro::rncandle::HybridRNCandleSpec>`.
|
|
@@ -265,5 +335,14 @@ namespace margelo::nitro::rncandle::bridge::swift {
|
|
|
265
335
|
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) {
|
|
266
336
|
return Result<std::shared_ptr<Promise<std::string>>>::withError(error);
|
|
267
337
|
}
|
|
338
|
+
|
|
339
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>>>
|
|
340
|
+
using Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_AnyMap_____ = Result<std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>>>;
|
|
341
|
+
inline Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_AnyMap_____ create_Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_AnyMap_____(const std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>>& value) {
|
|
342
|
+
return Result<std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>>>::withValue(value);
|
|
343
|
+
}
|
|
344
|
+
inline Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_AnyMap_____ create_Result_std__shared_ptr_Promise_std__vector_std__shared_ptr_AnyMap_____(const std::exception_ptr& error) {
|
|
345
|
+
return Result<std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>>>::withError(error);
|
|
346
|
+
}
|
|
268
347
|
|
|
269
348
|
} // namespace margelo::nitro::rncandle::bridge::swift
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
12
|
+
namespace NitroModules { class AnyMap; }
|
|
13
|
+
// Forward declaration of `AppUser` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::rncandle { struct AppUser; }
|
|
11
15
|
// Forward declaration of `Details` to properly resolve imports.
|
|
12
16
|
namespace margelo::nitro::rncandle { struct Details; }
|
|
13
17
|
// Forward declaration of `HybridRNCandleSpec` to properly resolve imports.
|
|
@@ -26,6 +30,7 @@ namespace margelo::nitro::rncandle { enum class State; }
|
|
|
26
30
|
namespace margelo::nitro::rncandle { struct ToolCall; }
|
|
27
31
|
|
|
28
32
|
// Include C++ defined types
|
|
33
|
+
#include "AppUser.hpp"
|
|
29
34
|
#include "Details.hpp"
|
|
30
35
|
#include "HybridRNCandleSpec.hpp"
|
|
31
36
|
#include "LinkedAccount.hpp"
|
|
@@ -34,6 +39,7 @@ namespace margelo::nitro::rncandle { struct ToolCall; }
|
|
|
34
39
|
#include "Service.hpp"
|
|
35
40
|
#include "State.hpp"
|
|
36
41
|
#include "ToolCall.hpp"
|
|
42
|
+
#include <NitroModules/AnyMap.hpp>
|
|
37
43
|
#include <NitroModules/Promise.hpp>
|
|
38
44
|
#include <NitroModules/Result.hpp>
|
|
39
45
|
#include <exception>
|
|
@@ -24,6 +24,10 @@ namespace margelo::nitro::rncandle { struct LinkedAccount; }
|
|
|
24
24
|
namespace margelo::nitro::rncandle { struct Details; }
|
|
25
25
|
// Forward declaration of `State` to properly resolve imports.
|
|
26
26
|
namespace margelo::nitro::rncandle { enum class State; }
|
|
27
|
+
// Forward declaration of `AppUser` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::rncandle { struct AppUser; }
|
|
29
|
+
// Forward declaration of `AnyMap` to properly resolve imports.
|
|
30
|
+
namespace NitroModules { class AnyMap; }
|
|
27
31
|
// Forward declaration of `ToolCall` to properly resolve imports.
|
|
28
32
|
namespace margelo::nitro::rncandle { struct ToolCall; }
|
|
29
33
|
|
|
@@ -34,10 +38,12 @@ namespace margelo::nitro::rncandle { struct ToolCall; }
|
|
|
34
38
|
#include "PresentationBackground.hpp"
|
|
35
39
|
#include "PresentationStyle.hpp"
|
|
36
40
|
#include <functional>
|
|
37
|
-
#include <NitroModules/Promise.hpp>
|
|
38
41
|
#include "LinkedAccount.hpp"
|
|
39
42
|
#include "Details.hpp"
|
|
40
43
|
#include "State.hpp"
|
|
44
|
+
#include "AppUser.hpp"
|
|
45
|
+
#include <NitroModules/Promise.hpp>
|
|
46
|
+
#include <NitroModules/AnyMap.hpp>
|
|
41
47
|
#include "ToolCall.hpp"
|
|
42
48
|
|
|
43
49
|
#include "ReactNativeCandle-Swift-Cxx-Umbrella.hpp"
|
|
@@ -79,12 +85,18 @@ namespace margelo::nitro::rncandle {
|
|
|
79
85
|
|
|
80
86
|
public:
|
|
81
87
|
// Methods
|
|
82
|
-
inline 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
|
|
88
|
+
inline 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 LinkedAccount& /* account */)>& onSuccess) override {
|
|
83
89
|
auto __result = _swiftPart.candleLinkSheet(std::forward<decltype(isPresented)>(isPresented), services, std::forward<decltype(cornerRadius)>(cornerRadius), customerName, std::forward<decltype(showDynamicLoading)>(showDynamicLoading), static_cast<int>(presentationBackground), static_cast<int>(presentationStyle), onSuccess);
|
|
84
90
|
if (__result.hasError()) [[unlikely]] {
|
|
85
91
|
std::rethrow_exception(__result.error());
|
|
86
92
|
}
|
|
87
93
|
}
|
|
94
|
+
inline void initialize(const AppUser& appUser) override {
|
|
95
|
+
auto __result = _swiftPart.initialize(appUser);
|
|
96
|
+
if (__result.hasError()) [[unlikely]] {
|
|
97
|
+
std::rethrow_exception(__result.error());
|
|
98
|
+
}
|
|
99
|
+
}
|
|
88
100
|
inline std::shared_ptr<Promise<std::vector<LinkedAccount>>> getLinkedAccounts() override {
|
|
89
101
|
auto __result = _swiftPart.getLinkedAccounts();
|
|
90
102
|
if (__result.hasError()) [[unlikely]] {
|
|
@@ -125,7 +137,7 @@ namespace margelo::nitro::rncandle {
|
|
|
125
137
|
auto __value = std::move(__result.value());
|
|
126
138
|
return __value;
|
|
127
139
|
}
|
|
128
|
-
inline std::shared_ptr<Promise<std::
|
|
140
|
+
inline std::shared_ptr<Promise<std::vector<std::shared_ptr<AnyMap>>>> getAvailableTools() override {
|
|
129
141
|
auto __result = _swiftPart.getAvailableTools();
|
|
130
142
|
if (__result.hasError()) [[unlikely]] {
|
|
131
143
|
std::rethrow_exception(__result.error());
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AppUser.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/// Represents an instance of `AppUser`, backed by a C++ struct.
|
|
11
|
+
public typealias AppUser = margelo.nitro.rncandle.AppUser
|
|
12
|
+
|
|
13
|
+
extension AppUser {
|
|
14
|
+
private typealias bridge = margelo.nitro.rncandle.bridge.swift
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Create a new instance of `AppUser`.
|
|
18
|
+
*/
|
|
19
|
+
public init(appKey: String, appSecret: String) {
|
|
20
|
+
self.init(std.string(appKey), std.string(appSecret))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public var appKey: String {
|
|
24
|
+
@inline(__always)
|
|
25
|
+
get {
|
|
26
|
+
return String(self.__appKey)
|
|
27
|
+
}
|
|
28
|
+
@inline(__always)
|
|
29
|
+
set {
|
|
30
|
+
self.__appKey = std.string(newValue)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public var appSecret: String {
|
|
35
|
+
@inline(__always)
|
|
36
|
+
get {
|
|
37
|
+
return String(self.__appSecret)
|
|
38
|
+
}
|
|
39
|
+
@inline(__always)
|
|
40
|
+
set {
|
|
41
|
+
self.__appSecret = std.string(newValue)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_LinkedAccount.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/// Wraps a Swift `(_ account: LinkedAccount) -> Void` as a class.
|
|
11
|
+
/// This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
12
|
+
public final class Func_void_LinkedAccount {
|
|
13
|
+
public typealias bridge = margelo.nitro.rncandle.bridge.swift
|
|
14
|
+
|
|
15
|
+
private let closure: (_ account: LinkedAccount) -> Void
|
|
16
|
+
|
|
17
|
+
public init(_ closure: @escaping (_ account: LinkedAccount) -> Void) {
|
|
18
|
+
self.closure = closure
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@inline(__always)
|
|
22
|
+
public func call(account: LinkedAccount) {
|
|
23
|
+
self.closure(account)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
28
|
+
* This acquires one additional strong reference on the object!
|
|
29
|
+
*/
|
|
30
|
+
@inline(__always)
|
|
31
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
32
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Casts an unsafe pointer to a `Func_void_LinkedAccount`.
|
|
37
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_LinkedAccount>`.
|
|
38
|
+
* This removes one strong reference from the object!
|
|
39
|
+
*/
|
|
40
|
+
@inline(__always)
|
|
41
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_LinkedAccount {
|
|
42
|
+
return Unmanaged<Func_void_LinkedAccount>.fromOpaque(pointer).takeRetainedValue()
|
|
43
|
+
}
|
|
44
|
+
}
|