@pinwheel/react-native-pinwheel 3.5.2 → 3.5.3

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.
@@ -32,7 +32,7 @@ repositories {
32
32
  google()
33
33
  }
34
34
 
35
- def PW_ANDROID_SDK_VERSION = '3.5.1'
35
+ def PW_ANDROID_SDK_VERSION = '3.5.2'
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.5.2", getReactNativeVersion(), this.handleInsets, this.useDarkMode)
92
+ val pinwheelFragment = PinwheelFragment.newInstanceWithAdvancedOptions(it, "react native", "3.5.3", getReactNativeVersion(), this.handleInsets, this.useDarkMode)
93
93
  pinwheelEventListener?.let { listener ->
94
94
  pinwheelFragment.pinwheelEventListener = listener
95
95
  }
@@ -74,7 +74,7 @@ using namespace facebook::react;
74
74
  [[PinwheelWrapperVC alloc] initWithToken:self.token
75
75
  delegate:self
76
76
  sdk:@"react native"
77
- version:@"3.5.2"
77
+ version:@"3.5.3"
78
78
  useDarkMode:self.useDarkMode
79
79
  useAppBoundDomains:NO
80
80
  useAppBoundDomainsForNativeLink:NO];
@@ -97,8 +97,6 @@ using namespace facebook::react;
97
97
  if (!self.pinwheelWrapperVC) {
98
98
  [self initPinwheelWrapperVC];
99
99
  }
100
- } else {
101
- [self cleanUpPinwheelWrapperVC];
102
100
  }
103
101
  }
104
102
 
@@ -239,7 +237,7 @@ Class<RCTComponentViewProtocol> RTNPinwheelCls(void) {
239
237
  [[PinwheelWrapperVC alloc] initWithToken:self.token
240
238
  delegate:self
241
239
  sdk:@"react native"
242
- version:@"3.5.2"
240
+ version:@"3.5.3"
243
241
  useDarkMode:self.useDarkMode
244
242
  useAppBoundDomains:NO
245
243
  useAppBoundDomainsForNativeLink:NO];
@@ -262,8 +260,6 @@ Class<RCTComponentViewProtocol> RTNPinwheelCls(void) {
262
260
  if (!self.pinwheelWrapperVC) {
263
261
  [self initPinwheelWrapperVC];
264
262
  }
265
- } else {
266
- [self cleanUpPinwheelWrapperVC];
267
263
  }
268
264
  }
269
265
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinwheel/react-native-pinwheel",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,80 +1,67 @@
1
1
  import type { AdditionsType, ModificationsType, RemovalsType } from '../utils';
2
- export type PinwheelErrorType =
3
- | 'sandboxError'
4
- | 'clientError'
5
- | 'systemError'
6
- | 'userActionRequired'
7
- | 'platformError'
8
- | 'invalidAccountsConfiguration'
9
- | 'invalidUserInput'
10
- | 'invalidLinkToken'
11
- | 'networkError';
2
+ export type PinwheelErrorType = 'sandboxError' | 'clientError' | 'systemError' | 'userActionRequired' | 'platformError' | 'invalidAccountsConfiguration' | 'invalidUserInput' | 'invalidLinkToken' | 'networkError';
12
3
  export type LinkApiJob = 'login' | 'direct_deposit_switch' | 'card_switch';
13
4
  export type OpenEventPayload = {};
14
5
  export type SelectEmployerEventPayload = {
15
- selectedEmployerId: string;
16
- selectedEmployerName: string;
6
+ selectedEmployerId: string;
7
+ selectedEmployerName: string;
17
8
  };
18
9
  export type SelectPlatformEventPayload = {
19
- selectedPlatformId: string;
20
- selectedPlatformName: string;
10
+ selectedPlatformId: string;
11
+ selectedPlatformName: string;
21
12
  };
22
13
  export type IncorrectPlatformGivenEventPayload = {};
23
14
  export type LoginAttemptEventPayload = {
24
- platformId: string;
15
+ platformId: string;
25
16
  };
26
17
  export type LoginEventPayload = {
27
- accountId: string;
28
- platformId: string;
18
+ accountId: string;
19
+ platformId: string;
29
20
  };
30
21
  export type InputAmountEventPayload = {
31
- value: number;
32
- unit: '$' | '%';
22
+ value: number;
23
+ unit: '$' | '%';
33
24
  };
34
25
  type _PartialSwitch<T> = {
35
- action: 'partial_switch';
36
- allocation: T;
26
+ action: 'partial_switch';
27
+ allocation: T;
37
28
  };
38
29
  type InputAllocationPercentage = _PartialSwitch<{
39
- type: 'percentage';
40
- value: number;
30
+ type: 'percentage';
31
+ value: number;
41
32
  }>;
42
33
  type InputAllocationAmount = _PartialSwitch<{
43
- type: 'amount';
44
- value: number;
34
+ type: 'amount';
35
+ value: number;
45
36
  }>;
46
37
  type InputAllocationRemainder = _PartialSwitch<{
47
- type: 'remainder';
38
+ type: 'remainder';
48
39
  }>;
49
- export type InputAllocationEventPayload =
50
- | {
51
- action: 'full_switch';
52
- }
53
- | InputAllocationRemainder
54
- | InputAllocationAmount
55
- | InputAllocationPercentage;
40
+ export type InputAllocationEventPayload = {
41
+ action: 'full_switch';
42
+ } | InputAllocationRemainder | InputAllocationAmount | InputAllocationPercentage;
56
43
  /**
57
44
  * @deprecated - Use `InputAllocationEventPayload` instead.
58
45
  */
59
46
  export type InputAllocation = InputAllocationEventPayload;
60
47
  export type CardSwitchBeginEventPayload = {};
61
48
  export type DocUploadsBeginEventPayload = {
62
- uploadedDocumentsSubmittedCount?: number;
49
+ uploadedDocumentsSubmittedCount?: number;
63
50
  };
64
51
  export type DocUploadsSubmittedEventPayload = {
65
- uploadedDocumentSubmittedCount: number;
52
+ uploadedDocumentSubmittedCount: number;
66
53
  };
67
54
  export type DdFormBeginEventPayload = {};
68
55
  export type DdFormCreateEventPayload = {
69
- url: string;
56
+ url: string;
70
57
  };
71
58
  export type DdFormDownloadEventPayload = {};
72
59
  export type ScreenTransitionEventPayload = {
73
- screenName: string;
74
- selectedEmployerId?: string;
75
- selectedEmployerName?: string;
76
- selectedPlatformId?: string;
77
- selectedPlatformName?: string;
60
+ screenName: string;
61
+ selectedEmployerId?: string;
62
+ selectedEmployerName?: string;
63
+ selectedPlatformId?: string;
64
+ selectedPlatformName?: string;
78
65
  };
79
66
  /**
80
67
  * @deprecated - Use `ScreenTransitionEventPayload` instead.
@@ -82,80 +69,74 @@ export type ScreenTransitionEventPayload = {
82
69
  export type ScreenTransition = ScreenTransitionEventPayload;
83
70
  export type ExitEventPayload = Record<string, never>;
84
71
  export type SuccessEventPayload = {
85
- accountId: string;
86
- platformId: string;
87
- job: LinkApiJob;
88
- params?: {
89
- amount?: {
90
- value: number;
91
- unit: '%' | '$';
72
+ accountId: string;
73
+ platformId: string;
74
+ job: LinkApiJob;
75
+ params?: {
76
+ amount?: {
77
+ value: number;
78
+ unit: '%' | '$';
79
+ };
92
80
  };
93
- };
94
81
  };
95
82
  export type ErrorEventPayload = {
96
- type: PinwheelErrorType;
97
- code: string;
98
- message: string;
99
- pendingRetry: boolean;
83
+ type: PinwheelErrorType;
84
+ code: string;
85
+ message: string;
86
+ pendingRetry: boolean;
100
87
  };
101
88
  export type OtherEventPayload = {
102
- name: string;
103
- payload: {
104
- key: string;
105
- value: string;
106
- type: 'string' | 'boolean' | 'number';
107
- }[];
89
+ name: string;
90
+ payload: {
91
+ key: string;
92
+ value: string;
93
+ type: 'string' | 'boolean' | 'number';
94
+ }[];
108
95
  };
109
96
  export type BillSwitchPayload = {
110
- platformId: string;
111
- platformName: string;
112
- isGuidedSwitch: boolean;
113
- frequency: string;
114
- nextPaymentDate: string;
115
- amountCents: number;
97
+ platformId: string;
98
+ platformName: string;
99
+ isGuidedSwitch: boolean;
100
+ isIntegratedSwitch: boolean;
101
+ frequency: string;
102
+ nextPaymentDate: string;
103
+ amountCents: number;
116
104
  };
117
105
  export type ExternalAccountConnectedPayload = {
118
- institutionName: string;
119
- accountName: string;
106
+ institutionName: string;
107
+ accountName: string;
120
108
  };
121
109
  /**
122
110
  * @deprecated - Use `ErrorEventPayload` instead.
123
111
  */
124
112
  export type PinwheelError = ErrorEventPayload;
125
113
  type EventPayloadAdditions = {
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;
114
+ open: OpenEventPayload;
115
+ select_employer: SelectEmployerEventPayload;
116
+ select_platform: SelectPlatformEventPayload;
117
+ incorrect_platform_given: IncorrectPlatformGivenEventPayload;
118
+ login_attempt: LoginAttemptEventPayload;
119
+ login: LoginEventPayload;
120
+ input_amount: InputAmountEventPayload;
121
+ input_allocation: InputAllocationEventPayload;
122
+ card_switch_begin: CardSwitchBeginEventPayload;
123
+ doc_uploads_begin: DocUploadsBeginEventPayload;
124
+ doc_uploads_submitted: DocUploadsSubmittedEventPayload;
125
+ dd_form_begin: DdFormBeginEventPayload;
126
+ dd_form_create: DdFormCreateEventPayload;
127
+ dd_form_download: DdFormDownloadEventPayload;
128
+ screen_transition: ScreenTransitionEventPayload;
129
+ exit: ErrorEventPayload | ExitEventPayload;
130
+ other_event: OtherEventPayload;
131
+ success: SuccessEventPayload;
132
+ error: ErrorEventPayload;
133
+ bill_switch_success: BillSwitchPayload;
134
+ bill_removed: BillSwitchPayload;
135
+ external_account_connected: ExternalAccountConnectedPayload;
136
+ merchant_login_success: LoginEventPayload;
149
137
  };
150
138
  type EventPayloadModifications = {};
151
139
  type EventPayloadRemovals = [];
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;
140
+ export type EventPayloadMap = Omit<AdditionsType<EventPayloadAdditions> & ModificationsType<EventPayloadModifications>, keyof RemovalsType<EventPayloadRemovals>>;
141
+ export type EventHandler = <T extends keyof EventPayloadMap>(eventName: T, payload: EventPayloadMap[T]) => void;
161
142
  export {};
@@ -126,7 +126,8 @@ export type OtherEventPayload = {
126
126
  export type BillSwitchPayload = {
127
127
  platformId: string;
128
128
  platformName: string;
129
- isGuidedSwitch: boolean;
129
+ isGuidedSwitch: boolean; // deprecated: will be removed in future version
130
+ isIntegratedSwitch: boolean;
130
131
  frequency: string;
131
132
  nextPaymentDate: string;
132
133
  amountCents: number;