@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.
- package/lib/Hub/types/AuthTypes.d.ts +13 -7
- package/lib/Platform/index.d.ts +2 -2
- package/lib/Platform/index.js +2 -5
- package/lib/Platform/types.d.ts +4 -55
- package/lib/Platform/types.js +36 -48
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/libraryUtils.d.ts +1 -1
- package/lib/singleton/Auth/index.js +1 -1
- package/lib/singleton/Auth/types.d.ts +2 -2
- package/lib/singleton/types.d.ts +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/Hub/types/AuthTypes.d.ts +13 -7
- package/lib-esm/Platform/index.d.ts +2 -2
- package/lib-esm/Platform/index.js +2 -5
- package/lib-esm/Platform/types.d.ts +4 -55
- package/lib-esm/Platform/types.js +36 -48
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/index.d.ts +1 -1
- package/lib-esm/libraryUtils.d.ts +1 -1
- package/lib-esm/singleton/Auth/index.js +1 -1
- package/lib-esm/singleton/Auth/types.d.ts +2 -2
- package/lib-esm/singleton/types.d.ts +2 -2
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/Cache/CHANGELOG.md +12 -0
- package/src/Hub/types/AuthTypes.ts +8 -6
- package/src/Platform/index.ts +3 -8
- package/src/Platform/types.ts +34 -56
- package/src/Platform/version.ts +1 -1
- package/src/index.ts +2 -2
- package/src/libraryUtils.ts +5 -1
- package/src/singleton/Auth/index.ts +1 -1
- package/src/singleton/Auth/types.ts +2 -2
- package/src/singleton/types.ts +5 -4
|
@@ -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
|
};
|
package/lib/Platform/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CustomUserAgentDetails, Framework } from './types';
|
|
2
|
-
import
|
|
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,
|
|
10
|
+
export declare const getAmplifyUserAgentObject: ({ category, action, framework, }?: CustomUserAgentDetails) => AWSUserAgent;
|
|
11
11
|
export declare const getAmplifyUserAgent: (customUserAgentDetails?: CustomUserAgentDetails) => string;
|
|
12
12
|
export {};
|
package/lib/Platform/index.js
CHANGED
|
@@ -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
|
|
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',
|
|
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;
|
package/lib/Platform/types.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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;
|
package/lib/Platform/types.js
CHANGED
|
@@ -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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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["
|
|
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-
|
|
1
|
+
export declare const version = "6.0.1-ui-preview.1aa6ecb.0+1aa6ecb";
|
package/lib/Platform/version.js
CHANGED
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,
|
|
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';
|
package/lib/libraryUtils.d.ts
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
38
|
+
getCredentialsAndIdentityId: (getCredentialsOptions: GetCredentialsOptions) => Promise<AWSCredentialsAndIdentityId | undefined>;
|
|
39
|
+
clearCredentialsAndIdentityId: () => void;
|
|
40
40
|
}
|
|
41
41
|
export type TokenProvider = {
|
|
42
42
|
getTokens: ({ forceRefresh, }?: {
|
package/lib/singleton/types.d.ts
CHANGED
|
@@ -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
|
|
14
|
+
export { AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, };
|