@pinwheel/react-native-pinwheel 3.4.0 → 3.5.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.
@@ -17,5 +17,5 @@ Pod::Spec.new do |s|
17
17
 
18
18
  install_modules_dependencies(s)
19
19
 
20
- s.dependency 'PinwheelSDK', '3.3.2'
20
+ s.dependency 'PinwheelSDK', '3.4.1'
21
21
  end
@@ -32,7 +32,7 @@ repositories {
32
32
  google()
33
33
  }
34
34
 
35
- def PW_ANDROID_SDK_VERSION = '3.4.1'
35
+ def PW_ANDROID_SDK_VERSION = '3.5.1'
36
36
 
37
37
  dependencies {
38
38
  def pwVersion = rootProject.hasProperty('pwVersion') ? rootProject.pwVersion : PW_ANDROID_SDK_VERSION
@@ -89,7 +89,7 @@ class Pinwheel : FrameLayout {
89
89
  Handler(Looper.getMainLooper()).post {
90
90
  if (this.pinwheelFragment == null) {
91
91
  this.token?.let {
92
- val pinwheelFragment = PinwheelFragment.newInstanceWithAdvancedOptions(it, "react native", "3.4.0", getReactNativeVersion(), this.handleInsets, this.useDarkMode)
92
+ val pinwheelFragment = PinwheelFragment.newInstanceWithAdvancedOptions(it, "react native", "3.5.1", getReactNativeVersion(), this.handleInsets, this.useDarkMode)
93
93
  pinwheelEventListener?.let { listener ->
94
94
  pinwheelFragment.pinwheelEventListener = listener
95
95
  }
@@ -43,7 +43,7 @@ using namespace facebook::react;
43
43
  }
44
44
 
45
45
  if (self.token != nil) {
46
- self.pinwheelWrapperVC = [[PinwheelWrapperVC alloc] initWithToken:self.token delegate:self sdk:@"react native" version:@"3.4.0" useDarkMode:self.useDarkMode useAppBoundDomains:NO useAppBoundDomainsForNativeLink:NO];
46
+ self.pinwheelWrapperVC = [[PinwheelWrapperVC alloc] initWithToken:self.token delegate:self sdk:@"react native" version:@"3.5.1" useDarkMode:self.useDarkMode useAppBoundDomains:NO useAppBoundDomainsForNativeLink:NO];
47
47
  [self addSubview:self.pinwheelWrapperVC.view];
48
48
  }
49
49
  }
@@ -145,7 +145,7 @@ Class<RCTComponentViewProtocol> RTNPinwheelCls(void)
145
145
  }
146
146
 
147
147
  if (self.token != nil) {
148
- self.pinwheelWrapperVC = [[PinwheelWrapperVC alloc] initWithToken:self.token delegate:self sdk:@"react native" version:@"3.4.0" useDarkMode:self.useDarkMode useAppBoundDomains:NO useAppBoundDomainsForNativeLink:NO];
148
+ self.pinwheelWrapperVC = [[PinwheelWrapperVC alloc] initWithToken:self.token delegate:self sdk:@"react native" version:@"3.5.1" useDarkMode:self.useDarkMode useAppBoundDomains:NO useAppBoundDomainsForNativeLink:NO];
149
149
  [self addSubview:self.pinwheelWrapperVC.view];
150
150
  }
151
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinwheel/react-native-pinwheel",
3
- "version": "3.4.0",
3
+ "version": "3.5.1",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,67 +1,80 @@
1
1
  import type { AdditionsType, ModificationsType, RemovalsType } from '../utils';
2
- export type PinwheelErrorType = 'sandboxError' | 'clientError' | 'systemError' | 'userActionRequired' | 'platformError' | 'invalidAccountsConfiguration' | 'invalidUserInput' | 'invalidLinkToken' | 'networkError';
2
+ export type PinwheelErrorType =
3
+ | 'sandboxError'
4
+ | 'clientError'
5
+ | 'systemError'
6
+ | 'userActionRequired'
7
+ | 'platformError'
8
+ | 'invalidAccountsConfiguration'
9
+ | 'invalidUserInput'
10
+ | 'invalidLinkToken'
11
+ | 'networkError';
3
12
  export type LinkApiJob = 'login' | 'direct_deposit_switch' | 'card_switch';
4
13
  export type OpenEventPayload = {};
5
14
  export type SelectEmployerEventPayload = {
6
- selectedEmployerId: string;
7
- selectedEmployerName: string;
15
+ selectedEmployerId: string;
16
+ selectedEmployerName: string;
8
17
  };
9
18
  export type SelectPlatformEventPayload = {
10
- selectedPlatformId: string;
11
- selectedPlatformName: string;
19
+ selectedPlatformId: string;
20
+ selectedPlatformName: string;
12
21
  };
13
22
  export type IncorrectPlatformGivenEventPayload = {};
14
23
  export type LoginAttemptEventPayload = {
15
- platformId: string;
24
+ platformId: string;
16
25
  };
17
26
  export type LoginEventPayload = {
18
- accountId: string;
19
- platformId: string;
27
+ accountId: string;
28
+ platformId: string;
20
29
  };
21
30
  export type InputAmountEventPayload = {
22
- value: number;
23
- unit: '$' | '%';
31
+ value: number;
32
+ unit: '$' | '%';
24
33
  };
25
34
  type _PartialSwitch<T> = {
26
- action: 'partial_switch';
27
- allocation: T;
35
+ action: 'partial_switch';
36
+ allocation: T;
28
37
  };
29
38
  type InputAllocationPercentage = _PartialSwitch<{
30
- type: 'percentage';
31
- value: number;
39
+ type: 'percentage';
40
+ value: number;
32
41
  }>;
33
42
  type InputAllocationAmount = _PartialSwitch<{
34
- type: 'amount';
35
- value: number;
43
+ type: 'amount';
44
+ value: number;
36
45
  }>;
37
46
  type InputAllocationRemainder = _PartialSwitch<{
38
- type: 'remainder';
47
+ type: 'remainder';
39
48
  }>;
40
- export type InputAllocationEventPayload = {
41
- action: 'full_switch';
42
- } | InputAllocationRemainder | InputAllocationAmount | InputAllocationPercentage;
49
+ export type InputAllocationEventPayload =
50
+ | {
51
+ action: 'full_switch';
52
+ }
53
+ | InputAllocationRemainder
54
+ | InputAllocationAmount
55
+ | InputAllocationPercentage;
43
56
  /**
44
57
  * @deprecated - Use `InputAllocationEventPayload` instead.
45
58
  */
46
59
  export type InputAllocation = InputAllocationEventPayload;
47
60
  export type CardSwitchBeginEventPayload = {};
48
61
  export type DocUploadsBeginEventPayload = {
49
- uploadedDocumentsSubmittedCount?: number;
62
+ uploadedDocumentsSubmittedCount?: number;
50
63
  };
51
64
  export type DocUploadsSubmittedEventPayload = {
52
- uploadedDocumentSubmittedCount: number;
65
+ uploadedDocumentSubmittedCount: number;
53
66
  };
54
67
  export type DdFormBeginEventPayload = {};
55
68
  export type DdFormCreateEventPayload = {
56
- url: string;
69
+ url: string;
57
70
  };
58
71
  export type DdFormDownloadEventPayload = {};
59
72
  export type ScreenTransitionEventPayload = {
60
- screenName: string;
61
- selectedEmployerId?: string;
62
- selectedEmployerName?: string;
63
- selectedPlatformId?: string;
64
- selectedPlatformName?: string;
73
+ screenName: string;
74
+ selectedEmployerId?: string;
75
+ selectedEmployerName?: string;
76
+ selectedPlatformId?: string;
77
+ selectedPlatformName?: string;
65
78
  };
66
79
  /**
67
80
  * @deprecated - Use `ScreenTransitionEventPayload` instead.
@@ -69,57 +82,80 @@ export type ScreenTransitionEventPayload = {
69
82
  export type ScreenTransition = ScreenTransitionEventPayload;
70
83
  export type ExitEventPayload = Record<string, never>;
71
84
  export type SuccessEventPayload = {
72
- accountId: string;
73
- platformId: string;
74
- job: LinkApiJob;
75
- params?: {
76
- amount?: {
77
- value: number;
78
- unit: '%' | '$';
79
- };
85
+ accountId: string;
86
+ platformId: string;
87
+ job: LinkApiJob;
88
+ params?: {
89
+ amount?: {
90
+ value: number;
91
+ unit: '%' | '$';
80
92
  };
93
+ };
81
94
  };
82
95
  export type ErrorEventPayload = {
83
- type: PinwheelErrorType;
84
- code: string;
85
- message: string;
86
- pendingRetry: boolean;
96
+ type: PinwheelErrorType;
97
+ code: string;
98
+ message: string;
99
+ pendingRetry: boolean;
87
100
  };
88
101
  export type OtherEventPayload = {
89
- name: string;
90
- payload: {
91
- key: string;
92
- value: string;
93
- type: 'string' | 'boolean' | 'number';
94
- }[];
102
+ name: string;
103
+ payload: {
104
+ key: string;
105
+ value: string;
106
+ type: 'string' | 'boolean' | 'number';
107
+ }[];
108
+ };
109
+ export type BillSwitchPayload = {
110
+ platformId: string;
111
+ platformName: string;
112
+ isGuidedSwitch: boolean;
113
+ frequency: string;
114
+ nextPaymentDate: string;
115
+ amountCents: number;
116
+ };
117
+ export type ExternalAccountConnectedPayload = {
118
+ institutionName: string;
119
+ accountName: string;
95
120
  };
96
121
  /**
97
122
  * @deprecated - Use `ErrorEventPayload` instead.
98
123
  */
99
124
  export type PinwheelError = ErrorEventPayload;
100
125
  type EventPayloadAdditions = {
101
- open: OpenEventPayload;
102
- select_employer: SelectEmployerEventPayload;
103
- select_platform: SelectPlatformEventPayload;
104
- incorrect_platform_given: IncorrectPlatformGivenEventPayload;
105
- login_attempt: LoginAttemptEventPayload;
106
- login: LoginEventPayload;
107
- input_amount: InputAmountEventPayload;
108
- input_allocation: InputAllocationEventPayload;
109
- card_switch_begin: CardSwitchBeginEventPayload;
110
- doc_uploads_begin: DocUploadsBeginEventPayload;
111
- doc_uploads_submitted: DocUploadsSubmittedEventPayload;
112
- dd_form_begin: DdFormBeginEventPayload;
113
- dd_form_create: DdFormCreateEventPayload;
114
- dd_form_download: DdFormDownloadEventPayload;
115
- screen_transition: ScreenTransitionEventPayload;
116
- exit: ErrorEventPayload | ExitEventPayload;
117
- other_event: OtherEventPayload;
118
- success: SuccessEventPayload;
119
- error: ErrorEventPayload;
126
+ open: OpenEventPayload;
127
+ select_employer: SelectEmployerEventPayload;
128
+ select_platform: SelectPlatformEventPayload;
129
+ incorrect_platform_given: IncorrectPlatformGivenEventPayload;
130
+ login_attempt: LoginAttemptEventPayload;
131
+ login: LoginEventPayload;
132
+ input_amount: InputAmountEventPayload;
133
+ input_allocation: InputAllocationEventPayload;
134
+ card_switch_begin: CardSwitchBeginEventPayload;
135
+ doc_uploads_begin: DocUploadsBeginEventPayload;
136
+ doc_uploads_submitted: DocUploadsSubmittedEventPayload;
137
+ dd_form_begin: DdFormBeginEventPayload;
138
+ dd_form_create: DdFormCreateEventPayload;
139
+ dd_form_download: DdFormDownloadEventPayload;
140
+ screen_transition: ScreenTransitionEventPayload;
141
+ exit: ErrorEventPayload | ExitEventPayload;
142
+ other_event: OtherEventPayload;
143
+ success: SuccessEventPayload;
144
+ error: ErrorEventPayload;
145
+ bill_switch_success: BillSwitchPayload;
146
+ bill_removed: BillSwitchPayload;
147
+ external_account_connected: ExternalAccountConnectedPayload;
148
+ merchant_login_success: LoginEventPayload;
120
149
  };
121
150
  type EventPayloadModifications = {};
122
151
  type EventPayloadRemovals = [];
123
- export type EventPayloadMap = Omit<AdditionsType<EventPayloadAdditions> & ModificationsType<EventPayloadModifications>, keyof RemovalsType<EventPayloadRemovals>>;
124
- export type EventHandler = <T extends keyof EventPayloadMap>(eventName: T, payload: EventPayloadMap[T]) => void;
152
+ export type EventPayloadMap = Omit<
153
+ AdditionsType<EventPayloadAdditions> &
154
+ ModificationsType<EventPayloadModifications>,
155
+ keyof RemovalsType<EventPayloadRemovals>
156
+ >;
157
+ export type EventHandler = <T extends keyof EventPayloadMap>(
158
+ eventName: T,
159
+ payload: EventPayloadMap[T]
160
+ ) => void;
125
161
  export {};
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/ban-types */
2
- import type { AdditionsType, ModificationsType, RemovalsType } from '../utils'
2
+ import type { AdditionsType, ModificationsType, RemovalsType } from '../utils';
3
3
 
4
4
  export type PinwheelErrorType =
5
5
  | 'sandboxError'
@@ -10,109 +10,109 @@ export type PinwheelErrorType =
10
10
  | 'invalidAccountsConfiguration'
11
11
  | 'invalidUserInput'
12
12
  | 'invalidLinkToken'
13
- | 'networkError'
13
+ | 'networkError';
14
14
 
15
- export type LinkApiJob = 'login' | 'direct_deposit_switch' | 'card_switch'
15
+ export type LinkApiJob = 'login' | 'direct_deposit_switch' | 'card_switch';
16
16
 
17
- export type OpenEventPayload = {}
17
+ export type OpenEventPayload = {};
18
18
 
19
19
  export type SelectEmployerEventPayload = {
20
- selectedEmployerId: string
21
- selectedEmployerName: string
22
- }
20
+ selectedEmployerId: string;
21
+ selectedEmployerName: string;
22
+ };
23
23
 
24
24
  export type SelectPlatformEventPayload = {
25
- selectedPlatformId: string
26
- selectedPlatformName: string
27
- }
25
+ selectedPlatformId: string;
26
+ selectedPlatformName: string;
27
+ };
28
28
 
29
- export type IncorrectPlatformGivenEventPayload = {}
29
+ export type IncorrectPlatformGivenEventPayload = {};
30
30
 
31
31
  export type LoginAttemptEventPayload = {
32
- platformId: string
33
- }
32
+ platformId: string;
33
+ };
34
34
 
35
35
  export type LoginEventPayload = {
36
- accountId: string
37
- platformId: string
38
- }
36
+ accountId: string;
37
+ platformId: string;
38
+ };
39
39
 
40
40
  export type InputAmountEventPayload = {
41
- value: number
42
- unit: '$' | '%'
43
- }
41
+ value: number;
42
+ unit: '$' | '%';
43
+ };
44
44
 
45
- type _PartialSwitch<T> = { action: 'partial_switch'; allocation: T }
45
+ type _PartialSwitch<T> = { action: 'partial_switch'; allocation: T };
46
46
  type InputAllocationPercentage = _PartialSwitch<{
47
- type: 'percentage'
48
- value: number
49
- }>
47
+ type: 'percentage';
48
+ value: number;
49
+ }>;
50
50
  type InputAllocationAmount = _PartialSwitch<{
51
- type: 'amount'
52
- value: number
53
- }>
51
+ type: 'amount';
52
+ value: number;
53
+ }>;
54
54
  type InputAllocationRemainder = _PartialSwitch<{
55
- type: 'remainder'
56
- }>
55
+ type: 'remainder';
56
+ }>;
57
57
  export type InputAllocationEventPayload =
58
58
  | { action: 'full_switch' }
59
59
  | InputAllocationRemainder
60
60
  | InputAllocationAmount
61
- | InputAllocationPercentage
61
+ | InputAllocationPercentage;
62
62
 
63
63
  /**
64
64
  * @deprecated - Use `InputAllocationEventPayload` instead.
65
65
  */
66
- export type InputAllocation = InputAllocationEventPayload
66
+ export type InputAllocation = InputAllocationEventPayload;
67
67
 
68
- export type CardSwitchBeginEventPayload = {}
68
+ export type CardSwitchBeginEventPayload = {};
69
69
 
70
70
  export type DocUploadsBeginEventPayload = {
71
- uploadedDocumentsSubmittedCount?: number
72
- }
71
+ uploadedDocumentsSubmittedCount?: number;
72
+ };
73
73
 
74
74
  export type DocUploadsSubmittedEventPayload = {
75
- uploadedDocumentSubmittedCount: number
76
- }
75
+ uploadedDocumentSubmittedCount: number;
76
+ };
77
77
 
78
- export type DdFormBeginEventPayload = {}
78
+ export type DdFormBeginEventPayload = {};
79
79
 
80
80
  export type DdFormCreateEventPayload = {
81
- url: string
82
- }
81
+ url: string;
82
+ };
83
83
 
84
- export type DdFormDownloadEventPayload = {}
84
+ export type DdFormDownloadEventPayload = {};
85
85
 
86
86
  export type ScreenTransitionEventPayload = {
87
- screenName: string
88
- selectedEmployerId?: string
89
- selectedEmployerName?: string
90
- selectedPlatformId?: string
91
- selectedPlatformName?: string
92
- }
87
+ screenName: string;
88
+ selectedEmployerId?: string;
89
+ selectedEmployerName?: string;
90
+ selectedPlatformId?: string;
91
+ selectedPlatformName?: string;
92
+ };
93
93
 
94
94
  /**
95
95
  * @deprecated - Use `ScreenTransitionEventPayload` instead.
96
96
  */
97
- export type ScreenTransition = ScreenTransitionEventPayload
97
+ export type ScreenTransition = ScreenTransitionEventPayload;
98
98
 
99
- export type ExitEventPayload = Record<string, never>
99
+ export type ExitEventPayload = Record<string, never>;
100
100
 
101
101
  export type SuccessEventPayload = {
102
- accountId: string
103
- platformId: string
104
- job: LinkApiJob
102
+ accountId: string;
103
+ platformId: string;
104
+ job: LinkApiJob;
105
105
  params?: {
106
- amount?: { value: number; unit: '%' | '$' }
107
- }
108
- }
106
+ amount?: { value: number; unit: '%' | '$' };
107
+ };
108
+ };
109
109
 
110
110
  export type ErrorEventPayload = {
111
- type: PinwheelErrorType
112
- code: string
113
- message: string
114
- pendingRetry: boolean
115
- }
111
+ type: PinwheelErrorType;
112
+ code: string;
113
+ message: string;
114
+ pendingRetry: boolean;
115
+ };
116
116
 
117
117
  export type OtherEventPayload = {
118
118
  name: string;
@@ -123,44 +123,62 @@ export type OtherEventPayload = {
123
123
  }[];
124
124
  };
125
125
 
126
+ export type BillSwitchPayload = {
127
+ platformId: string;
128
+ platformName: string;
129
+ isGuidedSwitch: boolean;
130
+ frequency: string;
131
+ nextPaymentDate: string;
132
+ amountCents: number;
133
+ };
134
+
135
+ export type ExternalAccountConnectedPayload = {
136
+ institutionName: string;
137
+ accountName: string;
138
+ };
139
+
126
140
  /**
127
141
  * @deprecated - Use `ErrorEventPayload` instead.
128
142
  */
129
- export type PinwheelError = ErrorEventPayload
143
+ export type PinwheelError = ErrorEventPayload;
130
144
 
131
145
  type EventPayloadAdditions = {
132
- open: OpenEventPayload
133
- select_employer: SelectEmployerEventPayload
134
- select_platform: SelectPlatformEventPayload
135
- incorrect_platform_given: IncorrectPlatformGivenEventPayload
136
- login_attempt: LoginAttemptEventPayload
137
- login: LoginEventPayload
138
- input_amount: InputAmountEventPayload
139
- input_allocation: InputAllocationEventPayload
140
- card_switch_begin: CardSwitchBeginEventPayload
141
- doc_uploads_begin: DocUploadsBeginEventPayload
142
- doc_uploads_submitted: DocUploadsSubmittedEventPayload
143
- dd_form_begin: DdFormBeginEventPayload
144
- dd_form_create: DdFormCreateEventPayload
145
- dd_form_download: DdFormDownloadEventPayload
146
- screen_transition: ScreenTransitionEventPayload
147
- exit: ErrorEventPayload | ExitEventPayload
146
+ open: OpenEventPayload;
147
+ select_employer: SelectEmployerEventPayload;
148
+ select_platform: SelectPlatformEventPayload;
149
+ incorrect_platform_given: IncorrectPlatformGivenEventPayload;
150
+ login_attempt: LoginAttemptEventPayload;
151
+ login: LoginEventPayload;
152
+ input_amount: InputAmountEventPayload;
153
+ input_allocation: InputAllocationEventPayload;
154
+ card_switch_begin: CardSwitchBeginEventPayload;
155
+ doc_uploads_begin: DocUploadsBeginEventPayload;
156
+ doc_uploads_submitted: DocUploadsSubmittedEventPayload;
157
+ dd_form_begin: DdFormBeginEventPayload;
158
+ dd_form_create: DdFormCreateEventPayload;
159
+ dd_form_download: DdFormDownloadEventPayload;
160
+ screen_transition: ScreenTransitionEventPayload;
161
+ exit: ErrorEventPayload | ExitEventPayload;
148
162
  other_event: OtherEventPayload;
149
- success: SuccessEventPayload
150
- error: ErrorEventPayload
151
- }
163
+ success: SuccessEventPayload;
164
+ error: ErrorEventPayload;
165
+ bill_switch_success: BillSwitchPayload;
166
+ bill_removed: BillSwitchPayload;
167
+ external_account_connected: ExternalAccountConnectedPayload;
168
+ merchant_login_success: LoginEventPayload;
169
+ };
152
170
 
153
- type EventPayloadModifications = {}
171
+ type EventPayloadModifications = {};
154
172
 
155
- type EventPayloadRemovals = []
173
+ type EventPayloadRemovals = [];
156
174
 
157
175
  export type EventPayloadMap = Omit<
158
176
  AdditionsType<EventPayloadAdditions> &
159
177
  ModificationsType<EventPayloadModifications>,
160
178
  keyof RemovalsType<EventPayloadRemovals>
161
- >
179
+ >;
162
180
 
163
181
  export type EventHandler = <T extends keyof EventPayloadMap>(
164
182
  eventName: T,
165
183
  payload: EventPayloadMap[T]
166
- ) => void
184
+ ) => void;