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