@aws-amplify/core 6.0.1-console-preview.2f5ba46.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/singleton/Auth/types.d.ts +1 -1
- 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/singleton/Auth/types.d.ts +1 -1
- 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/singleton/Auth/types.ts +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
// TODO Need to update types of data
|
|
5
4
|
export type AuthHubEventData =
|
|
6
|
-
|
|
7
|
-
| { event: '
|
|
8
|
-
|
|
9
|
-
| { event: '
|
|
10
|
-
|
|
5
|
+
/** Dispatched when a user signs in with an oauth provider such as Google.*/
|
|
6
|
+
| { event: 'signInWithRedirect' }
|
|
7
|
+
/** Dispatched when there is an error in the oauth flow process.*/
|
|
8
|
+
| { event: 'signInWithRedirect_failure' }
|
|
9
|
+
/** Dispatched when auth tokens are successfully refreshed.*/
|
|
10
|
+
| { event: 'tokenRefresh' }
|
|
11
|
+
/** Dispatched when there is an error in the refresh of tokens.*/
|
|
12
|
+
| { event: 'tokenRefresh_failure' };
|
package/src/Platform/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { CustomUserAgentDetails, Framework } from './types';
|
|
5
5
|
import { version } from './version';
|
|
6
6
|
import { detectFramework, observeFrameworkChanges } from './detectFramework';
|
|
7
|
-
import
|
|
7
|
+
import { UserAgent as AWSUserAgent } from '@aws-sdk/types';
|
|
8
8
|
|
|
9
9
|
const BASE_USER_AGENT = `aws-amplify`;
|
|
10
10
|
|
|
@@ -32,17 +32,12 @@ export const getAmplifyUserAgentObject = ({
|
|
|
32
32
|
category,
|
|
33
33
|
action,
|
|
34
34
|
framework,
|
|
35
|
-
additionalInfo,
|
|
36
35
|
}: CustomUserAgentDetails = {}): AWSUserAgent => {
|
|
37
|
-
|
|
36
|
+
const userAgent: AWSUserAgent = [[BASE_USER_AGENT, version]];
|
|
38
37
|
if (category) {
|
|
39
38
|
userAgent.push([category, action]);
|
|
40
39
|
}
|
|
41
|
-
userAgent.push(['framework',
|
|
42
|
-
|
|
43
|
-
if (additionalInfo) {
|
|
44
|
-
userAgent = userAgent.concat(additionalInfo);
|
|
45
|
-
}
|
|
40
|
+
userAgent.push(['framework', detectFramework()]);
|
|
46
41
|
|
|
47
42
|
return userAgent;
|
|
48
43
|
};
|
package/src/Platform/types.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import type { UserAgent as AWSUserAgent } from '@aws-sdk/types';
|
|
4
3
|
|
|
5
4
|
export enum Framework {
|
|
6
5
|
// < 100 - Web frameworks
|
|
@@ -54,63 +53,50 @@ export enum ApiAction {
|
|
|
54
53
|
Head = '7',
|
|
55
54
|
}
|
|
56
55
|
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',
|
|
56
|
+
// SignUp = '1',
|
|
57
|
+
// ConfirmSignUp = '2',
|
|
58
|
+
// ResendSignUp = '3',
|
|
59
|
+
// SignIn = '4',
|
|
60
|
+
// GetMFAOptions = '5',
|
|
61
|
+
// GetPreferredMFA = '6',
|
|
62
|
+
// SetPreferredMFA = '7',
|
|
63
|
+
// DisableSMS = '8',
|
|
64
|
+
// EnableSMS = '9',
|
|
65
|
+
// SetupTOTP = '10',
|
|
66
|
+
// VerifyTotpToken = '11',
|
|
67
|
+
// ConfirmSignIn = '12',
|
|
68
|
+
// CompleteNewPassword = '13',
|
|
69
|
+
// SendCustomChallengeAnswer = '14',
|
|
70
|
+
// DeleteUserAttributes = '15',
|
|
71
|
+
// DeleteUser = '16',
|
|
72
|
+
// UpdateUserAttributes = '17',
|
|
73
|
+
// UserAttributes = '18',
|
|
74
|
+
// CurrentUserPoolUser = '19',
|
|
75
|
+
// CurrentAuthenticatedUser = '20',
|
|
76
|
+
// CurrentSession = '21',
|
|
77
|
+
// VerifyUserAttribute = '22',
|
|
78
|
+
// VerifyUserAttributeSubmit = '23',
|
|
79
|
+
// VerifyCurrentUserAttribute = '24',
|
|
80
|
+
// VerifyCurrentUserAttributeSubmit = '25',
|
|
81
|
+
// SignOut = '26',
|
|
82
|
+
// ChangePassword = '27',
|
|
83
|
+
// ForgotPassword = '28',
|
|
84
|
+
// ForgotPasswordSubmit = '29',
|
|
86
85
|
FederatedSignIn = '30',
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
CurrentUserInfo = '35',
|
|
92
|
-
RememberDevice = '36',
|
|
93
|
-
ForgetDevice = '37',
|
|
94
|
-
FetchDevices = '38',
|
|
86
|
+
// CurrentUserInfo = '31',
|
|
87
|
+
// RememberDevice = '32',
|
|
88
|
+
// ForgetDevice = '33',
|
|
89
|
+
// FetchDevices = '34',
|
|
95
90
|
}
|
|
96
91
|
export enum DataStoreAction {
|
|
97
92
|
Subscribe = '1',
|
|
98
93
|
GraphQl = '2',
|
|
99
94
|
}
|
|
100
95
|
export enum GeoAction {
|
|
101
|
-
|
|
102
|
-
SearchForSuggestions = '2',
|
|
103
|
-
SearchByPlaceId = '3',
|
|
104
|
-
SearchByCoordinates = '4',
|
|
105
|
-
SaveGeofences = '5',
|
|
106
|
-
GetGeofence = '6',
|
|
107
|
-
ListGeofences = '7',
|
|
108
|
-
DeleteGeofences = '8',
|
|
96
|
+
None = '0',
|
|
109
97
|
}
|
|
110
98
|
export enum InAppMessagingAction {
|
|
111
99
|
None = '0',
|
|
112
|
-
SyncMessages = '1',
|
|
113
|
-
IdentifyUser = '2',
|
|
114
100
|
}
|
|
115
101
|
export enum InteractionsAction {
|
|
116
102
|
None = '0',
|
|
@@ -133,7 +119,6 @@ export enum StorageAction {
|
|
|
133
119
|
Copy = '4',
|
|
134
120
|
Remove = '5',
|
|
135
121
|
GetProperties = '6',
|
|
136
|
-
Cancel = '7',
|
|
137
122
|
}
|
|
138
123
|
|
|
139
124
|
type ActionMap = {
|
|
@@ -158,15 +143,8 @@ type UserAgentDetailsWithCategory<T extends Category> =
|
|
|
158
143
|
|
|
159
144
|
type CustomUserAgentDetailsBase = {
|
|
160
145
|
framework?: Framework;
|
|
161
|
-
// DO NOT REMOVE:
|
|
162
|
-
// Used by other Amplify teams to pass information to the custom user agent
|
|
163
|
-
/** Accepts an array of arrays with exactly 1 or 2 values and translates
|
|
164
|
-
those arrays to "item" or "item1/item2" strings on the custom user agent */
|
|
165
|
-
additionalInfo?: AWSUserAgent;
|
|
166
146
|
};
|
|
167
147
|
|
|
168
|
-
// DO NOT MAKE ANY PROP REQUIRED on CustomUserAgentDetails
|
|
169
|
-
// This object is used by other Amplify teams to pass information to the user agent
|
|
170
148
|
export type CustomUserAgentDetails =
|
|
171
149
|
| (CustomUserAgentDetailsBase & { category?: never; action?: never })
|
|
172
150
|
| UserAgentDetailsWithCategory<Category.API>
|
package/src/Platform/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '6.0.1-
|
|
2
|
+
export const version = '6.0.1-ui-preview.1aa6ecb.0+1aa6ecb';
|
|
@@ -49,7 +49,7 @@ export type Identity = {
|
|
|
49
49
|
export interface AWSCredentialsAndIdentityIdProvider {
|
|
50
50
|
getCredentialsAndIdentityId: (
|
|
51
51
|
getCredentialsOptions: GetCredentialsOptions
|
|
52
|
-
) => Promise<AWSCredentialsAndIdentityId>;
|
|
52
|
+
) => Promise<AWSCredentialsAndIdentityId | undefined>;
|
|
53
53
|
clearCredentialsAndIdentityId: () => void;
|
|
54
54
|
}
|
|
55
55
|
|