@aws-amplify/ui 6.6.4 → 6.6.5

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,5 +1,17 @@
1
- import { AuthAction, Category, StorageAction, InAppMessagingAction, GeoAction } from '@aws-amplify/core/internals/utils';
1
+ import { Category, AiAction, AuthAction, StorageAction, InAppMessagingAction, GeoAction } from '@aws-amplify/core/internals/utils';
2
2
 
3
+ const AI_INPUT_BASE = {
4
+ category: Category.AI,
5
+ apis: [
6
+ AiAction.CreateConversation,
7
+ AiAction.DeleteConversation,
8
+ AiAction.ListConversations,
9
+ AiAction.UpdateConversation,
10
+ AiAction.OnMessage,
11
+ AiAction.SendMessage,
12
+ AiAction.Generation,
13
+ ],
14
+ };
3
15
  const ACCOUNT_SETTINGS_INPUT_BASE = {
4
16
  apis: [AuthAction.DeleteUser, AuthAction.UpdatePassword],
5
17
  category: Category.Auth,
@@ -44,4 +56,4 @@ const STORAGE_MANAGER_INPUT_BASE = {
44
56
  category: Category.Storage,
45
57
  };
46
58
 
47
- export { ACCOUNT_SETTINGS_INPUT_BASE, AUTHENTICATOR_INPUT_BASE, FILE_UPLOADER_BASE_INPUT, IN_APP_MESSAGING_INPUT_BASE, LOCATION_SEARCH_INPUT_BASE, MAP_VIEW_INPUT_BASE, STORAGE_MANAGER_INPUT_BASE };
59
+ export { ACCOUNT_SETTINGS_INPUT_BASE, AI_INPUT_BASE, AUTHENTICATOR_INPUT_BASE, FILE_UPLOADER_BASE_INPUT, IN_APP_MESSAGING_INPUT_BASE, LOCATION_SEARCH_INPUT_BASE, MAP_VIEW_INPUT_BASE, STORAGE_MANAGER_INPUT_BASE };
@@ -1,5 +1,5 @@
1
1
  import { setCustomUserAgent } from '@aws-amplify/core/internals/utils';
2
- import { STORAGE_MANAGER_INPUT_BASE, MAP_VIEW_INPUT_BASE, LOCATION_SEARCH_INPUT_BASE, IN_APP_MESSAGING_INPUT_BASE, FILE_UPLOADER_BASE_INPUT, ACCOUNT_SETTINGS_INPUT_BASE, AUTHENTICATOR_INPUT_BASE } from './constants.mjs';
2
+ import { STORAGE_MANAGER_INPUT_BASE, MAP_VIEW_INPUT_BASE, LOCATION_SEARCH_INPUT_BASE, IN_APP_MESSAGING_INPUT_BASE, FILE_UPLOADER_BASE_INPUT, ACCOUNT_SETTINGS_INPUT_BASE, AUTHENTICATOR_INPUT_BASE, AI_INPUT_BASE } from './constants.mjs';
3
3
  import { noop } from '../utils.mjs';
4
4
 
5
5
  /**
@@ -15,6 +15,13 @@ import { noop } from '../utils.mjs';
15
15
  const setUserAgent = ({ componentName, packageName, version, }) => {
16
16
  const packageData = [`ui-${packageName}`, version];
17
17
  switch (componentName) {
18
+ case 'AIConversation': {
19
+ setCustomUserAgent({
20
+ ...AI_INPUT_BASE,
21
+ additionalDetails: [[componentName], packageData],
22
+ });
23
+ break;
24
+ }
18
25
  case 'Authenticator': {
19
26
  setCustomUserAgent({
20
27
  ...AUTHENTICATOR_INPUT_BASE,
package/dist/index.js CHANGED
@@ -36,6 +36,18 @@ const getActorContext$1 = (state) => {
36
36
  return getActorState(state)?.context;
37
37
  };
38
38
 
39
+ const AI_INPUT_BASE = {
40
+ category: utils.Category.AI,
41
+ apis: [
42
+ utils.AiAction.CreateConversation,
43
+ utils.AiAction.DeleteConversation,
44
+ utils.AiAction.ListConversations,
45
+ utils.AiAction.UpdateConversation,
46
+ utils.AiAction.OnMessage,
47
+ utils.AiAction.SendMessage,
48
+ utils.AiAction.Generation,
49
+ ],
50
+ };
39
51
  const ACCOUNT_SETTINGS_INPUT_BASE = {
40
52
  apis: [utils.AuthAction.DeleteUser, utils.AuthAction.UpdatePassword],
41
53
  category: utils.Category.Auth,
@@ -347,6 +359,13 @@ const cloneDeep = (obj) => {
347
359
  const setUserAgent = ({ componentName, packageName, version, }) => {
348
360
  const packageData = [`ui-${packageName}`, version];
349
361
  switch (componentName) {
362
+ case 'AIConversation': {
363
+ utils.setCustomUserAgent({
364
+ ...AI_INPUT_BASE,
365
+ additionalDetails: [[componentName], packageData],
366
+ });
367
+ break;
368
+ }
350
369
  case 'Authenticator': {
351
370
  utils.setCustomUserAgent({
352
371
  ...AUTHENTICATOR_INPUT_BASE,
@@ -1,4 +1,5 @@
1
- import { AuthUserAgentInput, GeoUserAgentInput, InAppMessagingUserAgentInput, StorageUserAgentInput } from '@aws-amplify/core/internals/utils';
1
+ import { AuthUserAgentInput, GeoUserAgentInput, InAppMessagingUserAgentInput, StorageUserAgentInput, AiUserAgentInput } from '@aws-amplify/core/internals/utils';
2
+ export declare const AI_INPUT_BASE: Omit<AiUserAgentInput, 'additionalDetails'>;
2
3
  export declare const ACCOUNT_SETTINGS_INPUT_BASE: Omit<AuthUserAgentInput, 'additionalDetails'>;
3
4
  export declare const AUTHENTICATOR_INPUT_BASE: Omit<AuthUserAgentInput, 'additionalDetails'>;
4
5
  export declare const FILE_UPLOADER_BASE_INPUT: Omit<StorageUserAgentInput, 'additionalDetails'>;
@@ -1,5 +1,5 @@
1
- export type PackageName = 'angular' | 'react' | 'react-auth' | 'react-geo' | 'react-liveness' | 'react-native' | 'react-native-auth' | 'react-notifications' | 'react-storage' | 'vue';
2
- export type ComponentName = 'Authenticator' | 'ChangePassword' | 'DeleteUser' | 'FaceLivenessDetector' | 'FileUploader' | 'InAppMessaging' | 'LocationSearch' | 'MapView' | 'StorageManager' | 'StorageImage';
1
+ export type PackageName = 'angular' | 'react' | 'react-ai' | 'react-auth' | 'react-geo' | 'react-liveness' | 'react-native' | 'react-native-auth' | 'react-notifications' | 'react-storage' | 'vue';
2
+ export type ComponentName = 'AIConversation' | 'Authenticator' | 'ChangePassword' | 'DeleteUser' | 'FaceLivenessDetector' | 'FileUploader' | 'InAppMessaging' | 'LocationSearch' | 'MapView' | 'StorageManager' | 'StorageImage';
3
3
  export type Version = `${string}.${string}.${string}`;
4
4
  export interface SetUserAgentOptions {
5
5
  componentName: ComponentName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui",
3
- "version": "6.6.4",
3
+ "version": "6.6.5",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@aws-amplify/core": "*",
53
- "aws-amplify": "^6.6.0",
53
+ "aws-amplify": "^6.6.5",
54
54
  "xstate": "^4.33.6"
55
55
  },
56
56
  "peerDependenciesMeta": {