@aws-amplify/core 5.6.0 → 5.6.1-v5-user-agent-for-ui.f058eee.7
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/Platform/index.d.ts +2 -2
- package/lib/Platform/index.js +5 -2
- package/lib/Platform/types.d.ts +17 -3
- package/lib/Platform/types.js +11 -3
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/Platform/index.d.ts +2 -2
- package/lib-esm/Platform/index.js +5 -2
- package/lib-esm/Platform/types.d.ts +17 -3
- package/lib-esm/Platform/types.js +11 -3
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Platform/index.ts +8 -3
- package/src/Platform/types.ts +19 -1
- package/src/Platform/version.ts +1 -1
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 { UserAgent as AWSUserAgent } from '@aws-sdk/types';
|
|
7
|
+
import type { UserAgent as AWSUserAgent } from '@aws-sdk/types';
|
|
8
8
|
|
|
9
9
|
const BASE_USER_AGENT = `aws-amplify`;
|
|
10
10
|
|
|
@@ -32,12 +32,17 @@ export const getAmplifyUserAgentObject = ({
|
|
|
32
32
|
category,
|
|
33
33
|
action,
|
|
34
34
|
framework,
|
|
35
|
+
additionalInfo,
|
|
35
36
|
}: CustomUserAgentDetails = {}): AWSUserAgent => {
|
|
36
|
-
|
|
37
|
+
let userAgent: AWSUserAgent = [[BASE_USER_AGENT, version]];
|
|
37
38
|
if (category) {
|
|
38
39
|
userAgent.push([category, action]);
|
|
39
40
|
}
|
|
40
|
-
userAgent.push(['framework', detectFramework()]);
|
|
41
|
+
userAgent.push(['framework', framework || detectFramework()]);
|
|
42
|
+
|
|
43
|
+
if (additionalInfo) {
|
|
44
|
+
userAgent = userAgent.concat(additionalInfo);
|
|
45
|
+
}
|
|
41
46
|
|
|
42
47
|
return userAgent;
|
|
43
48
|
};
|
package/src/Platform/types.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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';
|
|
3
4
|
|
|
4
5
|
export enum Framework {
|
|
5
6
|
// < 100 - Web frameworks
|
|
@@ -93,10 +94,19 @@ export enum DataStoreAction {
|
|
|
93
94
|
GraphQl = '2',
|
|
94
95
|
}
|
|
95
96
|
export enum GeoAction {
|
|
96
|
-
|
|
97
|
+
SearchByText = '1',
|
|
98
|
+
SearchForSuggestions = '2',
|
|
99
|
+
SearchByPlaceId = '3',
|
|
100
|
+
SearchByCoordinates = '4',
|
|
101
|
+
SaveGeofences = '5',
|
|
102
|
+
GetGeofence = '6',
|
|
103
|
+
ListGeofences = '7',
|
|
104
|
+
DeleteGeofences = '8',
|
|
97
105
|
}
|
|
98
106
|
export enum InAppMessagingAction {
|
|
99
107
|
None = '0',
|
|
108
|
+
SyncMessages = '1',
|
|
109
|
+
IdentifyUser = '2',
|
|
100
110
|
}
|
|
101
111
|
export enum InteractionsAction {
|
|
102
112
|
None = '0',
|
|
@@ -119,6 +129,7 @@ export enum StorageAction {
|
|
|
119
129
|
Copy = '4',
|
|
120
130
|
Remove = '5',
|
|
121
131
|
GetProperties = '6',
|
|
132
|
+
Cancel = '7',
|
|
122
133
|
}
|
|
123
134
|
|
|
124
135
|
type ActionMap = {
|
|
@@ -143,8 +154,15 @@ type UserAgentDetailsWithCategory<T extends Category> =
|
|
|
143
154
|
|
|
144
155
|
type CustomUserAgentDetailsBase = {
|
|
145
156
|
framework?: Framework;
|
|
157
|
+
// DO NOT REMOVE:
|
|
158
|
+
// Used by other Amplify teams to pass information to the custom user agent
|
|
159
|
+
/** Accepts an array of arrays with exactly 1 or 2 values and translates
|
|
160
|
+
those arrays to "item" or "item1/item2" strings on the custom user agent */
|
|
161
|
+
additionalInfo?: AWSUserAgent;
|
|
146
162
|
};
|
|
147
163
|
|
|
164
|
+
// DO NOT MAKE ANY PROP REQUIRED on CustomUserAgentDetails
|
|
165
|
+
// This object is used by other Amplify teams to pass information to the user agent
|
|
148
166
|
export type CustomUserAgentDetails =
|
|
149
167
|
| (CustomUserAgentDetailsBase & { category?: never; action?: never })
|
|
150
168
|
| UserAgentDetailsWithCategory<Category.API>
|
package/src/Platform/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '5.3.
|
|
2
|
+
export const version = '5.3.5-v5-user-agent-for-ui.f058eee.7+f058eee75';
|