@techstuff-dev/foundation-api-utils 1.11.0 → 1.12.0

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.
@@ -22,27 +22,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
22
22
  };
23
23
  authenticated: boolean;
24
24
  verifying: boolean;
25
- user: import("immer").WritableDraft<{
26
- accessToken: string;
27
- idToken: string;
28
- refreshToken: string;
29
- accessTokenExpiry?: number | undefined;
30
- details: {
31
- subscriptionDetails?: any;
32
- userSub?: string | undefined;
33
- userEmail?: string | undefined;
34
- lastName?: string | undefined;
35
- firstName?: string | undefined;
36
- avatar?: string | undefined;
37
- dateOfBirth?: string | undefined;
38
- termsAccepted: any;
39
- contactPreference: any;
40
- uuid?: string | undefined;
41
- subscription?: string | undefined;
42
- customerId?: string | undefined;
43
- };
44
- email?: string | undefined;
45
- }>;
25
+ user: import("immer").WritableDraft<import("../../types/index.interfaces").User>;
46
26
  loading: boolean;
47
27
  error: boolean;
48
28
  session?: string | undefined;
@@ -55,22 +35,25 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
55
35
  details: {
56
36
  subscription: any;
57
37
  subscriptionDetails: any;
58
- userSub?: string | undefined;
59
- userEmail?: string | undefined;
60
- lastName?: string | undefined;
38
+ userSub: string;
39
+ uuid?: string | undefined;
61
40
  firstName?: string | undefined;
41
+ lastName?: string | undefined;
42
+ userEmail?: string | undefined;
62
43
  avatar?: string | undefined;
44
+ termsAccepted?: string | undefined;
63
45
  dateOfBirth?: string | undefined;
64
- termsAccepted: any;
65
- contactPreference: any;
66
- uuid?: string | undefined;
67
- customerId?: string | undefined;
46
+ contactPreference: boolean;
47
+ password?: string | undefined;
48
+ passwordConfirm?: string | undefined;
49
+ agency?: boolean | undefined;
68
50
  };
69
51
  accessToken: string;
70
52
  idToken: string;
71
53
  refreshToken: string;
72
- accessTokenExpiry?: number | undefined;
73
- email?: string | undefined;
54
+ accessTokenExpiry: number | null;
55
+ email: string;
56
+ info?: import("immer").WritableDraft<import("../../types/index.interfaces").Info> | undefined;
74
57
  };
75
58
  authenticated: boolean;
76
59
  verifying: boolean;
@@ -87,20 +70,7 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
87
70
  isAuthenticated: (auth: AuthState) => boolean;
88
71
  selectAccessToken: (auth: AuthState) => string;
89
72
  selectRefreshToken: (auth: AuthState) => string;
90
- selectCurrentUser: (auth: AuthState) => {
91
- subscriptionDetails?: any;
92
- userSub?: string | undefined;
93
- userEmail?: string | undefined;
94
- lastName?: string | undefined;
95
- firstName?: string | undefined;
96
- avatar?: string | undefined;
97
- dateOfBirth?: string | undefined;
98
- termsAccepted: any;
99
- contactPreference: any;
100
- uuid?: string | undefined;
101
- subscription?: string | undefined;
102
- customerId?: string | undefined;
103
- };
73
+ selectCurrentUser: (auth: AuthState) => import("../../types/index.interfaces").UserDetails;
104
74
  selectUserCreating: (auth: AuthState) => {
105
75
  details: string;
106
76
  payment: string;
@@ -115,9 +85,75 @@ export declare const authSlice: import("@reduxjs/toolkit").Slice<AuthState, {
115
85
  refreshToken: string;
116
86
  idToken: string;
117
87
  };
118
- selectUserSubscriptionStatus: (auth: AuthState) => any;
119
- selectSubscription: (auth: AuthState) => string | undefined;
120
- selectSubscriptionPrice: (auth: AuthState) => any;
88
+ selectUserSubscriptionStatus: (auth: AuthState) => string | undefined;
89
+ selectSubscription: (auth: AuthState) => {
90
+ id: string;
91
+ created: number;
92
+ status: string;
93
+ nextPayment: number;
94
+ amount: number;
95
+ interval: string;
96
+ currency: string;
97
+ cancelAt: string;
98
+ planID: string;
99
+ planDescription: string;
100
+ paymentDetails: {
101
+ response: {
102
+ id: string;
103
+ object: string;
104
+ allow_redisplay: string;
105
+ billing_details: {
106
+ address: {
107
+ city: null;
108
+ country: null;
109
+ line1: null;
110
+ line2: null;
111
+ postal_code: null;
112
+ state: null;
113
+ };
114
+ email: null;
115
+ name: string;
116
+ phone: null;
117
+ };
118
+ card: {
119
+ brand: string;
120
+ checks: {
121
+ address_line1_check: null;
122
+ address_postal_code_check: null;
123
+ cvc_check: string;
124
+ };
125
+ country: string;
126
+ display_brand: string;
127
+ exp_month: number;
128
+ exp_year: number;
129
+ fingerprint: string;
130
+ funding: string;
131
+ generated_from: null;
132
+ last4: string;
133
+ networks: {
134
+ available: string[];
135
+ preferred: null;
136
+ };
137
+ three_d_secure_usage: {
138
+ supported: boolean;
139
+ };
140
+ wallet: null;
141
+ };
142
+ created: number;
143
+ customer: string;
144
+ livemode: boolean;
145
+ metadata: {};
146
+ type: string;
147
+ };
148
+ formatted: {
149
+ id: string;
150
+ maskedNumber: string;
151
+ expirationDate: string;
152
+ cardType: string;
153
+ };
154
+ };
155
+ } | undefined;
156
+ selectSubscriptionPrice: (auth: AuthState) => number | undefined;
121
157
  }>;
122
158
  export declare const setCredentials: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "auth/setCredentials">, resetCreating: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"auth/resetCreating">, logout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"auth/logout">, updateSubscription: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "auth/updateSubscription">;
123
159
  export declare const isAuthenticated: import("reselect").Selector<{
@@ -134,34 +170,8 @@ export declare const isAuthenticated: import("reselect").Selector<{
134
170
  unwrapped: (auth: AuthState) => string;
135
171
  }, selectCurrentUser: import("reselect").Selector<{
136
172
  auth: AuthState;
137
- }, {
138
- subscriptionDetails?: any;
139
- userSub?: string | undefined;
140
- userEmail?: string | undefined;
141
- lastName?: string | undefined;
142
- firstName?: string | undefined;
143
- avatar?: string | undefined;
144
- dateOfBirth?: string | undefined;
145
- termsAccepted: any;
146
- contactPreference: any;
147
- uuid?: string | undefined;
148
- subscription?: string | undefined;
149
- customerId?: string | undefined;
150
- }, []> & {
151
- unwrapped: (auth: AuthState) => {
152
- subscriptionDetails?: any;
153
- userSub?: string | undefined;
154
- userEmail?: string | undefined;
155
- lastName?: string | undefined;
156
- firstName?: string | undefined;
157
- avatar?: string | undefined;
158
- dateOfBirth?: string | undefined;
159
- termsAccepted: any;
160
- contactPreference: any;
161
- uuid?: string | undefined;
162
- subscription?: string | undefined;
163
- customerId?: string | undefined;
164
- };
173
+ }, import("../../types/index.interfaces").UserDetails, []> & {
174
+ unwrapped: (auth: AuthState) => import("../../types/index.interfaces").UserDetails;
165
175
  }, selectUserCreating: import("reselect").Selector<{
166
176
  auth: AuthState;
167
177
  }, {
@@ -206,16 +216,148 @@ export declare const isAuthenticated: import("reselect").Selector<{
206
216
  };
207
217
  }, selectUserSubscriptionStatus: import("reselect").Selector<{
208
218
  auth: AuthState;
209
- }, any, []> & {
210
- unwrapped: (auth: AuthState) => any;
211
- }, selectSubscription: import("reselect").Selector<{
212
- auth: AuthState;
213
219
  }, string | undefined, []> & {
214
220
  unwrapped: (auth: AuthState) => string | undefined;
221
+ }, selectSubscription: import("reselect").Selector<{
222
+ auth: AuthState;
223
+ }, {
224
+ id: string;
225
+ created: number;
226
+ status: string;
227
+ nextPayment: number;
228
+ amount: number;
229
+ interval: string;
230
+ currency: string;
231
+ cancelAt: string;
232
+ planID: string;
233
+ planDescription: string;
234
+ paymentDetails: {
235
+ response: {
236
+ id: string;
237
+ object: string;
238
+ allow_redisplay: string;
239
+ billing_details: {
240
+ address: {
241
+ city: null;
242
+ country: null;
243
+ line1: null;
244
+ line2: null;
245
+ postal_code: null;
246
+ state: null;
247
+ };
248
+ email: null;
249
+ name: string;
250
+ phone: null;
251
+ };
252
+ card: {
253
+ brand: string;
254
+ checks: {
255
+ address_line1_check: null;
256
+ address_postal_code_check: null;
257
+ cvc_check: string;
258
+ };
259
+ country: string;
260
+ display_brand: string;
261
+ exp_month: number;
262
+ exp_year: number;
263
+ fingerprint: string;
264
+ funding: string;
265
+ generated_from: null;
266
+ last4: string;
267
+ networks: {
268
+ available: string[];
269
+ preferred: null;
270
+ };
271
+ three_d_secure_usage: {
272
+ supported: boolean;
273
+ };
274
+ wallet: null;
275
+ };
276
+ created: number;
277
+ customer: string;
278
+ livemode: boolean;
279
+ metadata: {};
280
+ type: string;
281
+ };
282
+ formatted: {
283
+ id: string;
284
+ maskedNumber: string;
285
+ expirationDate: string;
286
+ cardType: string;
287
+ };
288
+ };
289
+ } | undefined, []> & {
290
+ unwrapped: (auth: AuthState) => {
291
+ id: string;
292
+ created: number;
293
+ status: string;
294
+ nextPayment: number;
295
+ amount: number;
296
+ interval: string;
297
+ currency: string;
298
+ cancelAt: string;
299
+ planID: string;
300
+ planDescription: string;
301
+ paymentDetails: {
302
+ response: {
303
+ id: string;
304
+ object: string;
305
+ allow_redisplay: string;
306
+ billing_details: {
307
+ address: {
308
+ city: null;
309
+ country: null;
310
+ line1: null;
311
+ line2: null;
312
+ postal_code: null;
313
+ state: null;
314
+ };
315
+ email: null;
316
+ name: string;
317
+ phone: null;
318
+ };
319
+ card: {
320
+ brand: string;
321
+ checks: {
322
+ address_line1_check: null;
323
+ address_postal_code_check: null;
324
+ cvc_check: string;
325
+ };
326
+ country: string;
327
+ display_brand: string;
328
+ exp_month: number;
329
+ exp_year: number;
330
+ fingerprint: string;
331
+ funding: string;
332
+ generated_from: null;
333
+ last4: string;
334
+ networks: {
335
+ available: string[];
336
+ preferred: null;
337
+ };
338
+ three_d_secure_usage: {
339
+ supported: boolean;
340
+ };
341
+ wallet: null;
342
+ };
343
+ created: number;
344
+ customer: string;
345
+ livemode: boolean;
346
+ metadata: {};
347
+ type: string;
348
+ };
349
+ formatted: {
350
+ id: string;
351
+ maskedNumber: string;
352
+ expirationDate: string;
353
+ cardType: string;
354
+ };
355
+ };
356
+ } | undefined;
215
357
  }, selectSubscriptionPrice: import("reselect").Selector<{
216
358
  auth: AuthState;
217
- }, any, []> & {
218
- unwrapped: (auth: AuthState) => any;
359
+ }, number | undefined, []> & {
360
+ unwrapped: (auth: AuthState) => number | undefined;
219
361
  };
220
362
  declare const _default: import("redux").Reducer<AuthState>;
221
363
  export default _default;
@@ -21,13 +21,78 @@ export type User = {
21
21
  accessTokenExpiry: number | null;
22
22
  details: UserDetails;
23
23
  email: string;
24
- info: Info;
24
+ info?: Info;
25
25
  };
26
26
  export type UserDetails = {
27
27
  userSub: string;
28
28
  uuid?: string;
29
+ subscription?: string;
29
30
  subscriptionDetails?: {
31
+ id: string;
32
+ created: number;
30
33
  status: string;
34
+ nextPayment: number;
35
+ amount: number;
36
+ interval: string;
37
+ currency: string;
38
+ cancelAt: string;
39
+ planID: string;
40
+ planDescription: string;
41
+ paymentDetails: {
42
+ response: {
43
+ id: string;
44
+ object: string;
45
+ allow_redisplay: string;
46
+ billing_details: {
47
+ address: {
48
+ city: null;
49
+ country: null;
50
+ line1: null;
51
+ line2: null;
52
+ postal_code: null;
53
+ state: null;
54
+ };
55
+ email: null;
56
+ name: string;
57
+ phone: null;
58
+ };
59
+ card: {
60
+ brand: string;
61
+ checks: {
62
+ address_line1_check: null;
63
+ address_postal_code_check: null;
64
+ cvc_check: string;
65
+ };
66
+ country: string;
67
+ display_brand: string;
68
+ exp_month: number;
69
+ exp_year: number;
70
+ fingerprint: string;
71
+ funding: string;
72
+ generated_from: null;
73
+ last4: string;
74
+ networks: {
75
+ available: string[];
76
+ preferred: null;
77
+ };
78
+ three_d_secure_usage: {
79
+ supported: boolean;
80
+ };
81
+ wallet: null;
82
+ };
83
+ created: number;
84
+ customer: string;
85
+ livemode: boolean;
86
+ metadata: {};
87
+ type: string;
88
+ };
89
+ formatted: {
90
+ id: string;
91
+ maskedNumber: string;
92
+ expirationDate: string;
93
+ cardType: string;
94
+ };
95
+ };
31
96
  };
32
97
  firstName?: string;
33
98
  lastName?: string;
@@ -38,7 +103,7 @@ export type UserDetails = {
38
103
  contactPreference: boolean;
39
104
  password?: string;
40
105
  passwordConfirm?: string;
41
- agency: boolean;
106
+ agency?: boolean;
42
107
  };
43
108
  export type Info = {
44
109
  orders?: string[];
@@ -92,27 +157,7 @@ export interface VerifyUserResponse {
92
157
  export interface AuthState {
93
158
  authenticated: boolean;
94
159
  verifying: boolean;
95
- user: {
96
- accessToken: string;
97
- idToken: string;
98
- refreshToken: string;
99
- accessTokenExpiry?: number;
100
- details: {
101
- subscriptionDetails?: any;
102
- userSub?: string;
103
- userEmail?: string;
104
- lastName?: string;
105
- firstName?: string;
106
- avatar?: string;
107
- dateOfBirth?: string;
108
- termsAccepted: any;
109
- contactPreference: any;
110
- uuid?: string;
111
- subscription?: string;
112
- customerId?: string;
113
- };
114
- email?: string;
115
- };
160
+ user: User;
116
161
  creating: {
117
162
  details: string;
118
163
  payment: string;
package/dist/index.esm.js CHANGED
@@ -86,9 +86,7 @@ var initialState = {
86
86
  userSub: '',
87
87
  uuid: '',
88
88
  subscription: '',
89
- subscriptionDetails: {
90
- status: '',
91
- },
89
+ subscriptionDetails: undefined,
92
90
  firstName: '',
93
91
  lastName: '',
94
92
  userEmail: '',
@@ -98,7 +96,7 @@ var initialState = {
98
96
  },
99
97
  accessToken: '',
100
98
  idToken: '',
101
- accessTokenExpiry: undefined,
99
+ accessTokenExpiry: null,
102
100
  refreshToken: '',
103
101
  email: '',
104
102
  },
@@ -147,13 +145,15 @@ var authSlice = createSlice({
147
145
  };
148
146
  },
149
147
  selectUserSubscriptionStatus: function (auth) {
150
- return auth.user.details.subscriptionDetails.status;
148
+ var _a;
149
+ return (_a = auth.user.details.subscriptionDetails) === null || _a === void 0 ? void 0 : _a.status;
151
150
  },
152
151
  selectSubscription: function (auth) {
153
- return auth.user.details.subscription;
152
+ return auth.user.details.subscriptionDetails;
154
153
  },
155
154
  selectSubscriptionPrice: function (auth) {
156
- return auth.user.details.subscriptionDetails.price;
155
+ var _a;
156
+ return (_a = auth.user.details.subscriptionDetails) === null || _a === void 0 ? void 0 : _a.amount;
157
157
  },
158
158
  },
159
159
  });