@aws-amplify/core 5.8.1 → 5.8.2-unstable.c3ec8a5.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.
@@ -7,7 +7,7 @@ import { detect } from './detection';
7
7
  // We want to cache detection since the framework won't change
8
8
  let frameworkCache: Framework | undefined;
9
9
 
10
- const frameworkChangeObservers: (() => void)[] = [];
10
+ export const frameworkChangeObservers: (() => void)[] = [];
11
11
 
12
12
  // Setup the detection reset tracking / timeout delays
13
13
  let resetTriggered = false;
@@ -19,8 +19,19 @@ export const detectFramework = (): Framework => {
19
19
  if (!frameworkCache) {
20
20
  frameworkCache = detect();
21
21
 
22
- // Everytime we update the cache, call each observer function
23
- frameworkChangeObservers.forEach(fcn => fcn());
22
+ if (resetTriggered) {
23
+ // The final run of detectFramework:
24
+ // Starting from this point, the `frameworkCache` becomes "final".
25
+ // So we don't need to notify the observers again so the observer
26
+ // can be removed after the final notice.
27
+ while (frameworkChangeObservers.length) {
28
+ frameworkChangeObservers.pop()();
29
+ }
30
+ } else {
31
+ // The first run of detectFramework:
32
+ // Every time we update the cache, call each observer function
33
+ frameworkChangeObservers.forEach(fcn => fcn());
34
+ }
24
35
 
25
36
  // Retry once for either Unknown type after a delay (explained below)
26
37
  resetTimeout(Framework.ServerSideUnknown, SSR_RESET_TIMEOUT);
@@ -33,6 +44,12 @@ export const detectFramework = (): Framework => {
33
44
  * @internal Setup observer callback that will be called everytime the framework changes
34
45
  */
35
46
  export const observeFrameworkChanges = (fcn: () => void) => {
47
+ // When the `frameworkCache` won't be updated again, we ignore all incoming
48
+ // observers.
49
+ if (resetTriggered) {
50
+ return;
51
+ }
52
+
36
53
  frameworkChangeObservers.push(fcn);
37
54
  };
38
55
 
@@ -54,40 +54,44 @@ export enum ApiAction {
54
54
  Head = '7',
55
55
  }
56
56
  export enum AuthAction {
57
- // SignUp = '1',
58
- // ConfirmSignUp = '2',
59
- // ResendSignUp = '3',
60
- // SignIn = '4',
61
- // GetMFAOptions = '5',
62
- // GetPreferredMFA = '6',
63
- // SetPreferredMFA = '7',
64
- // DisableSMS = '8',
65
- // EnableSMS = '9',
66
- // SetupTOTP = '10',
67
- // VerifyTotpToken = '11',
68
- // ConfirmSignIn = '12',
69
- // CompleteNewPassword = '13',
70
- // SendCustomChallengeAnswer = '14',
71
- // DeleteUserAttributes = '15',
72
- // DeleteUser = '16',
73
- // UpdateUserAttributes = '17',
74
- // UserAttributes = '18',
75
- // CurrentUserPoolUser = '19',
76
- // CurrentAuthenticatedUser = '20',
77
- // CurrentSession = '21',
78
- // VerifyUserAttribute = '22',
79
- // VerifyUserAttributeSubmit = '23',
80
- // VerifyCurrentUserAttribute = '24',
81
- // VerifyCurrentUserAttributeSubmit = '25',
82
- // SignOut = '26',
83
- // ChangePassword = '27',
84
- // ForgotPassword = '28',
85
- // ForgotPasswordSubmit = '29',
57
+ SignUp = '1',
58
+ ConfirmSignUp = '2',
59
+ ResendSignUp = '3',
60
+ SignIn = '4',
61
+ GetMFAOptions = '5',
62
+ GetPreferredMFA = '6',
63
+ SetPreferredMFA = '7',
64
+ DisableSMS = '8',
65
+ EnableSMS = '9',
66
+ SetupTOTP = '10',
67
+ VerifyTotpToken = '11',
68
+ ConfirmSignIn = '12',
69
+ CompleteNewPassword = '13',
70
+ SendCustomChallengeAnswer = '14',
71
+ DeleteUserAttributes = '15',
72
+ DeleteUser = '16',
73
+ UpdateUserAttributes = '17',
74
+ UserAttributes = '18',
75
+ CurrentUserPoolUser = '19',
76
+ CurrentAuthenticatedUser = '20',
77
+ CurrentSession = '21',
78
+ VerifyUserAttribute = '22',
79
+ VerifyUserAttributeSubmit = '23',
80
+ VerifyCurrentUserAttribute = '24',
81
+ VerifyCurrentUserAttributeSubmit = '25',
82
+ SignOut = '26',
83
+ ChangePassword = '27',
84
+ ForgotPassword = '28',
85
+ ForgotPasswordSubmit = '29',
86
86
  FederatedSignIn = '30',
87
- // CurrentUserInfo = '31',
88
- // RememberDevice = '32',
89
- // ForgetDevice = '33',
90
- // FetchDevices = '34',
87
+ VerifiedContact = '31',
88
+ UserSession = '32',
89
+ CurrentUserCredentials = '33',
90
+ CurrentCredentials = '34',
91
+ CurrentUserInfo = '35',
92
+ RememberDevice = '36',
93
+ ForgetDevice = '37',
94
+ FetchDevices = '38',
91
95
  }
92
96
  export enum DataStoreAction {
93
97
  Subscribe = '1',
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '5.3.7';
2
+ export const version = '5.3.8-unstable.c3ec8a5.0+c3ec8a5';