@aws-amplify/core 6.0.1-console-preview.3b09ef9.0 → 6.0.1-ui-preview.1aa6ecb.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,11 +1,17 @@
1
- export type AuthHubEventData = {
1
+ export type AuthHubEventData =
2
+ /** Dispatched when a user signs in with an oauth provider such as Google.*/
3
+ {
2
4
  event: 'signInWithRedirect';
3
- } | {
5
+ }
6
+ /** Dispatched when there is an error in the oauth flow process.*/
7
+ | {
8
+ event: 'signInWithRedirect_failure';
9
+ }
10
+ /** Dispatched when auth tokens are successfully refreshed.*/
11
+ | {
4
12
  event: 'tokenRefresh';
5
- } | {
13
+ }
14
+ /** Dispatched when there is an error in the refresh of tokens.*/
15
+ | {
6
16
  event: 'tokenRefresh_failure';
7
- } | {
8
- event: 'customOAuthState';
9
- } | {
10
- event: 'customState_failure';
11
17
  };
@@ -1,5 +1,5 @@
1
1
  import { CustomUserAgentDetails, Framework } from './types';
2
- import type { UserAgent as AWSUserAgent } from '@aws-sdk/types';
2
+ import { UserAgent as AWSUserAgent } from '@aws-sdk/types';
3
3
  declare class PlatformBuilder {
4
4
  userAgent: string;
5
5
  get framework(): Framework;
@@ -7,6 +7,6 @@ declare class PlatformBuilder {
7
7
  observeFrameworkChanges(fcn: () => void): void;
8
8
  }
9
9
  export declare const Platform: PlatformBuilder;
10
- export declare const getAmplifyUserAgentObject: ({ category, action, framework, additionalInfo, }?: CustomUserAgentDetails) => AWSUserAgent;
10
+ export declare const getAmplifyUserAgentObject: ({ category, action, framework, }?: CustomUserAgentDetails) => AWSUserAgent;
11
11
  export declare const getAmplifyUserAgent: (customUserAgentDetails?: CustomUserAgentDetails) => string;
12
12
  export {};
@@ -49,15 +49,12 @@ var PlatformBuilder = /** @class */ (function () {
49
49
  }());
50
50
  exports.Platform = new PlatformBuilder();
51
51
  var getAmplifyUserAgentObject = function (_a) {
52
- var _b = _a === void 0 ? {} : _a, category = _b.category, action = _b.action, framework = _b.framework, additionalInfo = _b.additionalInfo;
52
+ var _b = _a === void 0 ? {} : _a, category = _b.category, action = _b.action, framework = _b.framework;
53
53
  var userAgent = [[BASE_USER_AGENT, version_1.version]];
54
54
  if (category) {
55
55
  userAgent.push([category, action]);
56
56
  }
57
- userAgent.push(['framework', framework || (0, detectFramework_1.detectFramework)()]);
58
- if (additionalInfo) {
59
- userAgent = userAgent.concat(additionalInfo);
60
- }
57
+ userAgent.push(['framework', (0, detectFramework_1.detectFramework)()]);
61
58
  return userAgent;
62
59
  };
63
60
  exports.getAmplifyUserAgentObject = getAmplifyUserAgentObject;
@@ -1,4 +1,3 @@
1
- import type { UserAgent as AWSUserAgent } from '@aws-sdk/types';
2
1
  export declare enum Framework {
3
2
  WebUnknown = "0",
4
3
  React = "1",
@@ -44,63 +43,17 @@ export declare enum ApiAction {
44
43
  Head = "7"
45
44
  }
46
45
  export declare enum AuthAction {
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"
46
+ FederatedSignIn = "30"
85
47
  }
86
48
  export declare enum DataStoreAction {
87
49
  Subscribe = "1",
88
50
  GraphQl = "2"
89
51
  }
90
52
  export declare enum GeoAction {
91
- SearchByText = "1",
92
- SearchForSuggestions = "2",
93
- SearchByPlaceId = "3",
94
- SearchByCoordinates = "4",
95
- SaveGeofences = "5",
96
- GetGeofence = "6",
97
- ListGeofences = "7",
98
- DeleteGeofences = "8"
53
+ None = "0"
99
54
  }
100
55
  export declare enum InAppMessagingAction {
101
- None = "0",
102
- SyncMessages = "1",
103
- IdentifyUser = "2"
56
+ None = "0"
104
57
  }
105
58
  export declare enum InteractionsAction {
106
59
  None = "0"
@@ -122,8 +75,7 @@ export declare enum StorageAction {
122
75
  List = "3",
123
76
  Copy = "4",
124
77
  Remove = "5",
125
- GetProperties = "6",
126
- Cancel = "7"
78
+ GetProperties = "6"
127
79
  }
128
80
  type ActionMap = {
129
81
  [Category.Auth]: AuthAction;
@@ -144,9 +96,6 @@ type UserAgentDetailsWithCategory<T extends Category> = CustomUserAgentDetailsBa
144
96
  };
145
97
  type CustomUserAgentDetailsBase = {
146
98
  framework?: Framework;
147
- /** Accepts an array of arrays with exactly 1 or 2 values and translates
148
- those arrays to "item" or "item1/item2" strings on the custom user agent */
149
- additionalInfo?: AWSUserAgent;
150
99
  };
151
100
  export type CustomUserAgentDetails = (CustomUserAgentDetailsBase & {
152
101
  category?: never;
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.StorageAction = exports.PushNotificationAction = exports.PubSubAction = exports.PredictionsAction = exports.InteractionsAction = exports.InAppMessagingAction = exports.GeoAction = exports.DataStoreAction = exports.AuthAction = exports.ApiAction = exports.AnalyticsAction = exports.Category = exports.Framework = void 0;
4
6
  var Framework;
@@ -54,44 +56,40 @@ var ApiAction;
54
56
  })(ApiAction = exports.ApiAction || (exports.ApiAction = {}));
55
57
  var AuthAction;
56
58
  (function (AuthAction) {
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";
59
+ // SignUp = '1',
60
+ // ConfirmSignUp = '2',
61
+ // ResendSignUp = '3',
62
+ // SignIn = '4',
63
+ // GetMFAOptions = '5',
64
+ // GetPreferredMFA = '6',
65
+ // SetPreferredMFA = '7',
66
+ // DisableSMS = '8',
67
+ // EnableSMS = '9',
68
+ // SetupTOTP = '10',
69
+ // VerifyTotpToken = '11',
70
+ // ConfirmSignIn = '12',
71
+ // CompleteNewPassword = '13',
72
+ // SendCustomChallengeAnswer = '14',
73
+ // DeleteUserAttributes = '15',
74
+ // DeleteUser = '16',
75
+ // UpdateUserAttributes = '17',
76
+ // UserAttributes = '18',
77
+ // CurrentUserPoolUser = '19',
78
+ // CurrentAuthenticatedUser = '20',
79
+ // CurrentSession = '21',
80
+ // VerifyUserAttribute = '22',
81
+ // VerifyUserAttributeSubmit = '23',
82
+ // VerifyCurrentUserAttribute = '24',
83
+ // VerifyCurrentUserAttributeSubmit = '25',
84
+ // SignOut = '26',
85
+ // ChangePassword = '27',
86
+ // ForgotPassword = '28',
87
+ // ForgotPasswordSubmit = '29',
86
88
  AuthAction["FederatedSignIn"] = "30";
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";
89
+ // CurrentUserInfo = '31',
90
+ // RememberDevice = '32',
91
+ // ForgetDevice = '33',
92
+ // FetchDevices = '34',
95
93
  })(AuthAction = exports.AuthAction || (exports.AuthAction = {}));
96
94
  var DataStoreAction;
97
95
  (function (DataStoreAction) {
@@ -100,20 +98,11 @@ var DataStoreAction;
100
98
  })(DataStoreAction = exports.DataStoreAction || (exports.DataStoreAction = {}));
101
99
  var GeoAction;
102
100
  (function (GeoAction) {
103
- GeoAction["SearchByText"] = "1";
104
- GeoAction["SearchForSuggestions"] = "2";
105
- GeoAction["SearchByPlaceId"] = "3";
106
- GeoAction["SearchByCoordinates"] = "4";
107
- GeoAction["SaveGeofences"] = "5";
108
- GeoAction["GetGeofence"] = "6";
109
- GeoAction["ListGeofences"] = "7";
110
- GeoAction["DeleteGeofences"] = "8";
101
+ GeoAction["None"] = "0";
111
102
  })(GeoAction = exports.GeoAction || (exports.GeoAction = {}));
112
103
  var InAppMessagingAction;
113
104
  (function (InAppMessagingAction) {
114
105
  InAppMessagingAction["None"] = "0";
115
- InAppMessagingAction["SyncMessages"] = "1";
116
- InAppMessagingAction["IdentifyUser"] = "2";
117
106
  })(InAppMessagingAction = exports.InAppMessagingAction || (exports.InAppMessagingAction = {}));
118
107
  var InteractionsAction;
119
108
  (function (InteractionsAction) {
@@ -141,5 +130,4 @@ var StorageAction;
141
130
  StorageAction["Copy"] = "4";
142
131
  StorageAction["Remove"] = "5";
143
132
  StorageAction["GetProperties"] = "6";
144
- StorageAction["Cancel"] = "7";
145
133
  })(StorageAction = exports.StorageAction || (exports.StorageAction = {}));
@@ -1 +1 @@
1
- export declare const version = "6.0.1-console-preview.3b09ef9.0+3b09ef9";
1
+ export declare const version = "6.0.1-ui-preview.1aa6ecb.0+1aa6ecb";
@@ -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 = '6.0.1-console-preview.3b09ef9.0+3b09ef9';
5
+ exports.version = '6.0.1-ui-preview.1aa6ecb.0+1aa6ecb';
package/lib/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { AppState, AsyncStorage, Linking } from './RNComponents';
7
7
  export { Credentials, CredentialsClass } from './Credentials';
8
8
  export { ICredentials } from './types';
9
9
  export { TokenProvider, AuthTokens, FetchAuthSessionOptions, AWSCredentialsAndIdentityIdProvider, AWSCredentialsAndIdentityId, Identity, OAuthConfig, CognitoUserPoolConfig, } from './singleton/Auth/types';
10
- export { AuthConfig, UserPoolConfig, UserPoolConfigAndIdentityPoolConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, ResourcesConfig, LibraryOptions, AnalyticsConfig, } from './singleton/types';
10
+ export { AuthConfig, AuthUserPoolConfig, AuthUserPoolAndIdentityPoolConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, ResourcesConfig, LibraryOptions, AnalyticsConfig, } from './singleton/types';
11
11
  export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, clearCredentials, } from './singleton';
12
12
  export { getCredentialsForIdentity, getId, GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, } from './AwsClients/CognitoIdentity';
13
13
  export { UserProfile } from './types';
@@ -1,5 +1,5 @@
1
1
  export { browserOrNode, filenameToContentType, generateRandomString, isEmpty, isStrictObject, isTextFile, isWebWorker, makeQuerablePromise, objectLessAttributes, sortByField, transferKeyToLowerCase, transferKeyToUpperCase, } from './Util/JS';
2
- export { JWT, StrictUnion } from './singleton/Auth/types';
2
+ export { JWT, StrictUnion, CognitoIdentityPoolConfig, } from './singleton/Auth/types';
3
3
  export { decodeJWT, assertTokenProviderConfig, assertIdentityPooIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
4
4
  export { isTokenExpired } from './singleton/Auth';
5
5
  export { Signer } from './Signer';
@@ -122,7 +122,7 @@ var AuthClass = /** @class */ (function () {
122
122
  switch (_b.label) {
123
123
  case 0:
124
124
  if (!((_a = this.authOptions) === null || _a === void 0 ? void 0 : _a.credentialsProvider)) return [3 /*break*/, 2];
125
- return [4 /*yield*/, this.authOptions.credentialsProvider.clearCredentials()];
125
+ return [4 /*yield*/, this.authOptions.credentialsProvider.clearCredentialsAndIdentityId()];
126
126
  case 1: return [2 /*return*/, _b.sent()];
127
127
  case 2: return [2 /*return*/];
128
128
  }
@@ -35,8 +35,8 @@ export type Identity = {
35
35
  type: 'guest' | 'primary';
36
36
  };
37
37
  export interface AWSCredentialsAndIdentityIdProvider {
38
- getCredentialsAndIdentityId: (getCredentialsOptions: GetCredentialsOptions) => Promise<AWSCredentialsAndIdentityId>;
39
- clearCredentials: () => void;
38
+ getCredentialsAndIdentityId: (getCredentialsOptions: GetCredentialsOptions) => Promise<AWSCredentialsAndIdentityId | undefined>;
39
+ clearCredentialsAndIdentityId: () => void;
40
40
  }
41
41
  export type TokenProvider = {
42
42
  getTokens: ({ forceRefresh, }?: {
@@ -1,5 +1,5 @@
1
1
  import { AnalyticsConfig } from './Analytics/types';
2
- import { AuthConfig, LibraryAuthOptions, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions } from './Auth/types';
2
+ import { AuthConfig, LibraryAuthOptions, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, CognitoIdentityPoolConfig } from './Auth/types';
3
3
  import { LibraryStorageOptions, StorageAccessLevel, StorageConfig } from './Storage/types';
4
4
  export type ResourcesConfig = {
5
5
  Analytics?: AnalyticsConfig;
@@ -11,4 +11,4 @@ export type LibraryOptions = {
11
11
  Auth?: LibraryAuthOptions;
12
12
  Storage?: LibraryStorageOptions;
13
13
  };
14
- export { AuthConfig, AuthUserPoolConfig as UserPoolConfig, AuthIdentityPoolConfig as IdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig as UserPoolConfigAndIdentityPoolConfig, GetCredentialsOptions, StorageAccessLevel, StorageConfig, AnalyticsConfig, };
14
+ export { AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, };