@outerjoyn/react-native 1.4.0 → 1.4.1
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/package.json +1 -1
- package/src/OuterJoynProvider.tsx +1 -1
- package/src/core/types.ts +16 -11
- package/src/screens/AccountScreen.tsx +3 -1
- package/src/screens/RedeemScreen.tsx +2 -1
- package/src/types.ts +7 -4
package/package.json
CHANGED
|
@@ -592,7 +592,7 @@ export function OuterJoynProvider({
|
|
|
592
592
|
);
|
|
593
593
|
|
|
594
594
|
const openExchange = useCallback(
|
|
595
|
-
(opts?: { sourceCurrencyId?: number }) => {
|
|
595
|
+
(opts?: { sourceCurrencyId?: number | string }) => {
|
|
596
596
|
analyticsRef.current?.trackOpen('exchange');
|
|
597
597
|
openSheet('exchange', opts ?? {});
|
|
598
598
|
},
|
package/src/core/types.ts
CHANGED
|
@@ -14,7 +14,9 @@ export interface CreateSessionResponse {
|
|
|
14
14
|
status: 'ready' | 'link_required';
|
|
15
15
|
expires_at: string;
|
|
16
16
|
member_context?: {
|
|
17
|
-
|
|
17
|
+
// Snowflake IDs ride as JSON strings on the wire post-audit-D2b; the
|
|
18
|
+
// legacy numeric shape is still accepted from pre-D2b servers.
|
|
19
|
+
member_id: number | string;
|
|
18
20
|
display_name?: string;
|
|
19
21
|
linked_programs?: Array<{ program_name: string; currency_name: string }>;
|
|
20
22
|
};
|
|
@@ -23,9 +25,9 @@ export interface CreateSessionResponse {
|
|
|
23
25
|
|
|
24
26
|
export interface SessionContextResponse {
|
|
25
27
|
status: string;
|
|
26
|
-
member_id: number | null;
|
|
28
|
+
member_id: number | string | null;
|
|
27
29
|
display_name?: string;
|
|
28
|
-
business_unit_id: number;
|
|
30
|
+
business_unit_id: number | string;
|
|
29
31
|
scopes: string[];
|
|
30
32
|
expires_at: string;
|
|
31
33
|
payable_balances?: PayableBalance[];
|
|
@@ -34,9 +36,12 @@ export interface SessionContextResponse {
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
export interface PayableBalance {
|
|
39
|
+
// Snowflake IDs (memberCurrencyId/currencyId/partnershipId) ride as JSON
|
|
40
|
+
// strings on the wire post-audit-D2; kept `number | string` to also accept
|
|
41
|
+
// the legacy numeric shape. Amounts/balances stay numeric.
|
|
37
42
|
// Go gateway returns camelCase
|
|
38
|
-
memberCurrencyId?: number;
|
|
39
|
-
currencyId?: number;
|
|
43
|
+
memberCurrencyId?: number | string;
|
|
44
|
+
currencyId?: number | string;
|
|
40
45
|
currencyName?: string;
|
|
41
46
|
currencyCode?: string;
|
|
42
47
|
brandName?: string;
|
|
@@ -45,10 +50,10 @@ export interface PayableBalance {
|
|
|
45
50
|
balance?: number;
|
|
46
51
|
pointValueAmount?: number;
|
|
47
52
|
valueAmount?: number;
|
|
48
|
-
partnershipId?: number;
|
|
53
|
+
partnershipId?: number | string;
|
|
49
54
|
// Express returns snake_case
|
|
50
|
-
member_currency_id?: number;
|
|
51
|
-
currency_id?: number;
|
|
55
|
+
member_currency_id?: number | string;
|
|
56
|
+
currency_id?: number | string;
|
|
52
57
|
currency_name?: string;
|
|
53
58
|
currency_code?: string;
|
|
54
59
|
brand_name?: string;
|
|
@@ -56,7 +61,7 @@ export interface PayableBalance {
|
|
|
56
61
|
brand_color?: string | null;
|
|
57
62
|
point_value_amount?: number;
|
|
58
63
|
value_amount?: number;
|
|
59
|
-
partnership_id?: number;
|
|
64
|
+
partnership_id?: number | string;
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
export interface BrandConfig {
|
|
@@ -87,7 +92,7 @@ export interface LinkedProgram {
|
|
|
87
92
|
brandLogoUrl: string | null;
|
|
88
93
|
brandColor: string | null;
|
|
89
94
|
/** Partnership ID — used for disconnect. May be undefined for demo programs. */
|
|
90
|
-
partnershipId?: number;
|
|
95
|
+
partnershipId?: number | string;
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
// =============================================================================
|
|
@@ -183,7 +188,7 @@ export interface OuterJoynContextValue {
|
|
|
183
188
|
// Actions
|
|
184
189
|
refreshBalances: () => Promise<void>;
|
|
185
190
|
openConnect: (opts?: { institutionId?: string }) => void;
|
|
186
|
-
openExchange: (opts?: { sourceCurrencyId?: number }) => void;
|
|
191
|
+
openExchange: (opts?: { sourceCurrencyId?: number | string }) => void;
|
|
187
192
|
openRedeem: (opts?: { category?: string }) => void;
|
|
188
193
|
openPay: (opts: { orderTotalCents: number; merchantOrderId?: string }) => void;
|
|
189
194
|
openAccount: () => void;
|
|
@@ -67,7 +67,9 @@ interface ConnectedBrand {
|
|
|
67
67
|
total_redeemed: number;
|
|
68
68
|
scopes: string[];
|
|
69
69
|
linked_at: string;
|
|
70
|
-
|
|
70
|
+
// Snowflake ID: JSON string on the wire post-audit-D2; sourced from the
|
|
71
|
+
// widened LinkedProgram.partnershipId. Legacy numeric shape still accepted.
|
|
72
|
+
partnership_id?: number | string;
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
interface ActivityItem {
|
|
@@ -63,7 +63,8 @@ interface RedemptionResult {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
interface CatalogItem {
|
|
66
|
-
|
|
66
|
+
// Snowflake catalog ID: JSON string on the wire post-audit-D2; legacy numeric accepted.
|
|
67
|
+
product_id: number | string;
|
|
67
68
|
name: string;
|
|
68
69
|
description: string;
|
|
69
70
|
short_description?: string;
|
package/src/types.ts
CHANGED
|
@@ -99,26 +99,29 @@ export interface PromotionsViewProps extends OuterJoynConfig {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
export interface PayResult {
|
|
102
|
-
|
|
102
|
+
// Snowflake ID: JSON string on the wire post-audit-D2b; legacy numeric accepted.
|
|
103
|
+
reservationId: number | string;
|
|
103
104
|
status: string;
|
|
104
105
|
pointsUsed: number;
|
|
105
106
|
valueAmount: number;
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
export interface ConnectResult {
|
|
109
|
-
|
|
110
|
+
// Snowflake ID: emitted as a JSON string on the wire (see audit D2). Widened
|
|
111
|
+
// to accept the legacy numeric shape too for pre-D2 servers.
|
|
112
|
+
linkedProgramId: number | string;
|
|
110
113
|
programName: string;
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
export interface ExchangeResult {
|
|
114
|
-
transactionId: number;
|
|
117
|
+
transactionId: number | string;
|
|
115
118
|
sourceAmount: number;
|
|
116
119
|
targetAmount: number;
|
|
117
120
|
rate: number;
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
export interface RedeemResult {
|
|
121
|
-
redemptionId: number;
|
|
124
|
+
redemptionId: number | string;
|
|
122
125
|
status: string;
|
|
123
126
|
}
|
|
124
127
|
|