@microsoft/agents-activity 0.1.49

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.
Files changed (130) hide show
  1. package/README.md +22 -0
  2. package/dist/src/action/actionTypes.d.ts +25 -0
  3. package/dist/src/action/actionTypes.js +30 -0
  4. package/dist/src/action/actionTypes.js.map +1 -0
  5. package/dist/src/action/cardAction.d.ts +74 -0
  6. package/dist/src/action/cardAction.js +23 -0
  7. package/dist/src/action/cardAction.js.map +1 -0
  8. package/dist/src/action/semanticAction.d.ts +52 -0
  9. package/dist/src/action/semanticAction.js +19 -0
  10. package/dist/src/action/semanticAction.js.map +1 -0
  11. package/dist/src/action/semanticActionStateTypes.d.ts +17 -0
  12. package/dist/src/action/semanticActionStateTypes.js +22 -0
  13. package/dist/src/action/semanticActionStateTypes.js.map +1 -0
  14. package/dist/src/action/suggestedActions.d.ts +77 -0
  15. package/dist/src/action/suggestedActions.js +17 -0
  16. package/dist/src/action/suggestedActions.js.map +1 -0
  17. package/dist/src/activity.d.ts +811 -0
  18. package/dist/src/activity.js +264 -0
  19. package/dist/src/activity.js.map +1 -0
  20. package/dist/src/activityEventNames.d.ts +16 -0
  21. package/dist/src/activityEventNames.js +21 -0
  22. package/dist/src/activityEventNames.js.map +1 -0
  23. package/dist/src/activityImportance.d.ts +17 -0
  24. package/dist/src/activityImportance.js +22 -0
  25. package/dist/src/activityImportance.js.map +1 -0
  26. package/dist/src/activityTypes.d.ts +33 -0
  27. package/dist/src/activityTypes.js +58 -0
  28. package/dist/src/activityTypes.js.map +1 -0
  29. package/dist/src/attachment/attachment.d.ts +37 -0
  30. package/dist/src/attachment/attachment.js +19 -0
  31. package/dist/src/attachment/attachment.js.map +1 -0
  32. package/dist/src/attachment/attachmentLayoutTypes.d.ts +16 -0
  33. package/dist/src/attachment/attachmentLayoutTypes.js +21 -0
  34. package/dist/src/attachment/attachmentLayoutTypes.js.map +1 -0
  35. package/dist/src/callerIdConstants.d.ts +21 -0
  36. package/dist/src/callerIdConstants.js +25 -0
  37. package/dist/src/callerIdConstants.js.map +1 -0
  38. package/dist/src/conversation/channelAccount.d.ts +38 -0
  39. package/dist/src/conversation/channelAccount.js +20 -0
  40. package/dist/src/conversation/channelAccount.js.map +1 -0
  41. package/dist/src/conversation/channels.d.ts +28 -0
  42. package/dist/src/conversation/channels.js +33 -0
  43. package/dist/src/conversation/channels.js.map +1 -0
  44. package/dist/src/conversation/conversationAccount.d.ts +50 -0
  45. package/dist/src/conversation/conversationAccount.js +23 -0
  46. package/dist/src/conversation/conversationAccount.js.map +1 -0
  47. package/dist/src/conversation/conversationReference.d.ts +152 -0
  48. package/dist/src/conversation/conversationReference.js +23 -0
  49. package/dist/src/conversation/conversationReference.js.map +1 -0
  50. package/dist/src/conversation/endOfConversationCodes.d.ts +20 -0
  51. package/dist/src/conversation/endOfConversationCodes.js +25 -0
  52. package/dist/src/conversation/endOfConversationCodes.js.map +1 -0
  53. package/dist/src/conversation/roleTypes.d.ts +17 -0
  54. package/dist/src/conversation/roleTypes.js +22 -0
  55. package/dist/src/conversation/roleTypes.js.map +1 -0
  56. package/dist/src/deliveryModes.d.ts +18 -0
  57. package/dist/src/deliveryModes.js +23 -0
  58. package/dist/src/deliveryModes.js.map +1 -0
  59. package/dist/src/entity/entity.d.ts +28 -0
  60. package/dist/src/entity/entity.js +15 -0
  61. package/dist/src/entity/entity.js.map +1 -0
  62. package/dist/src/entity/geoCoordinates.d.ts +29 -0
  63. package/dist/src/entity/geoCoordinates.js +7 -0
  64. package/dist/src/entity/geoCoordinates.js.map +1 -0
  65. package/dist/src/entity/mention.d.ts +22 -0
  66. package/dist/src/entity/mention.js +7 -0
  67. package/dist/src/entity/mention.js.map +1 -0
  68. package/dist/src/entity/place.d.ts +29 -0
  69. package/dist/src/entity/place.js +7 -0
  70. package/dist/src/entity/place.js.map +1 -0
  71. package/dist/src/entity/thing.d.ts +17 -0
  72. package/dist/src/entity/thing.js +7 -0
  73. package/dist/src/entity/thing.js.map +1 -0
  74. package/dist/src/expectedReplies.d.ts +14 -0
  75. package/dist/src/expectedReplies.js +7 -0
  76. package/dist/src/expectedReplies.js.map +1 -0
  77. package/dist/src/index.d.ts +38 -0
  78. package/dist/src/index.js +57 -0
  79. package/dist/src/index.js.map +1 -0
  80. package/dist/src/inputHints.d.ts +17 -0
  81. package/dist/src/inputHints.js +22 -0
  82. package/dist/src/inputHints.js.map +1 -0
  83. package/dist/src/invoke/adaptiveCardInvokeAction.d.ts +45 -0
  84. package/dist/src/invoke/adaptiveCardInvokeAction.js +18 -0
  85. package/dist/src/invoke/adaptiveCardInvokeAction.js.map +1 -0
  86. package/dist/src/messageReaction.d.ts +25 -0
  87. package/dist/src/messageReaction.js +16 -0
  88. package/dist/src/messageReaction.js.map +1 -0
  89. package/dist/src/messageReactionTypes.d.ts +16 -0
  90. package/dist/src/messageReactionTypes.js +21 -0
  91. package/dist/src/messageReactionTypes.js.map +1 -0
  92. package/dist/src/textFormatTypes.d.ts +17 -0
  93. package/dist/src/textFormatTypes.js +22 -0
  94. package/dist/src/textFormatTypes.js.map +1 -0
  95. package/dist/src/textHighlight.d.ts +31 -0
  96. package/dist/src/textHighlight.js +16 -0
  97. package/dist/src/textHighlight.js.map +1 -0
  98. package/package.json +44 -0
  99. package/src/action/actionTypes.ts +28 -0
  100. package/src/action/cardAction.ts +59 -0
  101. package/src/action/semanticAction.ts +35 -0
  102. package/src/action/semanticActionStateTypes.ts +20 -0
  103. package/src/action/suggestedActions.ts +29 -0
  104. package/src/activity.ts +334 -0
  105. package/src/activityEventNames.ts +19 -0
  106. package/src/activityImportance.ts +20 -0
  107. package/src/activityTypes.ts +56 -0
  108. package/src/attachment/attachment.ts +28 -0
  109. package/src/attachment/attachmentLayoutTypes.ts +19 -0
  110. package/src/callerIdConstants.ts +22 -0
  111. package/src/conversation/channelAccount.ts +29 -0
  112. package/src/conversation/channels.ts +29 -0
  113. package/src/conversation/conversationAccount.ts +35 -0
  114. package/src/conversation/conversationReference.ts +34 -0
  115. package/src/conversation/endOfConversationCodes.ts +23 -0
  116. package/src/conversation/roleTypes.ts +20 -0
  117. package/src/deliveryModes.ts +21 -0
  118. package/src/entity/entity.ts +27 -0
  119. package/src/entity/geoCoordinates.ts +30 -0
  120. package/src/entity/mention.ts +24 -0
  121. package/src/entity/place.ts +30 -0
  122. package/src/entity/thing.ts +18 -0
  123. package/src/expectedReplies.ts +16 -0
  124. package/src/index.ts +44 -0
  125. package/src/inputHints.ts +20 -0
  126. package/src/invoke/adaptiveCardInvokeAction.ts +38 -0
  127. package/src/messageReaction.ts +24 -0
  128. package/src/messageReactionTypes.ts +19 -0
  129. package/src/textFormatTypes.ts +20 -0
  130. package/src/textHighlight.ts +28 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+ import { ChannelAccount, channelAccountZodSchema } from './channelAccount'
8
+ import { ConversationAccount, conversationAccountZodSchema } from './conversationAccount'
9
+
10
+ /**
11
+ * Interface representing a reference to a conversation.
12
+ */
13
+ export interface ConversationReference {
14
+ activityId?: string
15
+ user?: ChannelAccount
16
+ locale?: string
17
+ bot?: ChannelAccount | undefined | null
18
+ conversation: ConversationAccount
19
+ channelId: string
20
+ serviceUrl?: string | undefined
21
+ }
22
+
23
+ /**
24
+ * Zod schema for validating a conversation reference.
25
+ */
26
+ export const conversationReferenceZodSchema = z.object({
27
+ activityId: z.string().min(1).optional(),
28
+ user: channelAccountZodSchema.optional(),
29
+ locale: z.string().min(1).optional(),
30
+ bot: channelAccountZodSchema.optional().nullable(),
31
+ conversation: conversationAccountZodSchema,
32
+ channelId: z.string().min(1),
33
+ serviceUrl: z.string().min(1).optional()
34
+ })
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+
8
+ /**
9
+ * Enum representing the different end of conversation codes.
10
+ */
11
+ export enum EndOfConversationCodes {
12
+ Unknown = 'unknown',
13
+ CompletedSuccessfully = 'completedSuccessfully',
14
+ UserCancelled = 'userCancelled',
15
+ BotTimedOut = 'botTimedOut',
16
+ BotIssuedInvalidMessage = 'botIssuedInvalidMessage',
17
+ ChannelFailed = 'channelFailed',
18
+ }
19
+
20
+ /**
21
+ * Zod schema for validating end of conversation codes.
22
+ */
23
+ export const endOfConversationCodesZodSchema = z.enum(['unknown', 'completedSuccessfully', 'userCancelled', 'botTimedOut', 'botIssuedInvalidMessage', 'channelFailed'])
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+
8
+ /**
9
+ * Enum representing the different role types in a conversation.
10
+ */
11
+ export enum RoleTypes {
12
+ User = 'user',
13
+ Bot = 'bot',
14
+ Skill = 'skill',
15
+ }
16
+
17
+ /**
18
+ * Zod schema for validating role types.
19
+ */
20
+ export const roleTypeZodSchema = z.enum(['user', 'bot', 'skill'])
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+
8
+ /**
9
+ * Enum representing delivery modes.
10
+ */
11
+ export enum DeliveryModes {
12
+ Normal = 'normal',
13
+ Notification = 'notification',
14
+ ExpectReplies = 'expectReplies',
15
+ Ephemeral = 'ephemeral',
16
+ }
17
+
18
+ /**
19
+ * Zod schema for validating a DeliveryModes enum.
20
+ */
21
+ export const deliveryModesZodSchema = z.enum(['normal', 'notification', 'expectReplies', 'ephemeral'])
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+
8
+ /**
9
+ * Represents a generic Entity.
10
+ */
11
+ export interface Entity {
12
+ /**
13
+ * The type of the entity.
14
+ */
15
+ type: string
16
+ /**
17
+ * Additional properties of the entity.
18
+ */
19
+ [key: string]: unknown
20
+ }
21
+
22
+ /**
23
+ * Zod schema for validating Entity objects.
24
+ */
25
+ export const entityZodSchema = z.object({
26
+ type: z.string().min(1)
27
+ })
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Represents geographical coordinates.
8
+ */
9
+ export interface GeoCoordinates {
10
+ /**
11
+ * The elevation of the location.
12
+ */
13
+ elevation: number
14
+ /**
15
+ * The latitude of the location.
16
+ */
17
+ latitude: number
18
+ /**
19
+ * The longitude of the location.
20
+ */
21
+ longitude: number
22
+ /**
23
+ * The type of the geographical coordinates.
24
+ */
25
+ type: string
26
+ /**
27
+ * The name of the geographical coordinates.
28
+ */
29
+ name: string
30
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { ChannelAccount } from '../conversation/channelAccount'
7
+
8
+ /**
9
+ * Represents a Mention entity.
10
+ */
11
+ export interface Mention {
12
+ /**
13
+ * The account that is mentioned.
14
+ */
15
+ mentioned: ChannelAccount
16
+ /**
17
+ * The text of the mention.
18
+ */
19
+ text: string
20
+ /**
21
+ * The type of the mention.
22
+ */
23
+ type: string
24
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Represents a Place entity.
8
+ */
9
+ export interface Place {
10
+ /**
11
+ * The address of the place.
12
+ */
13
+ address: unknown
14
+ /**
15
+ * The geographical coordinates of the place.
16
+ */
17
+ geo: unknown
18
+ /**
19
+ * A map that shows the place.
20
+ */
21
+ hasMap: unknown
22
+ /**
23
+ * The type of the place.
24
+ */
25
+ type: string
26
+ /**
27
+ * The name of the place.
28
+ */
29
+ name: string
30
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Represents a Thing entity.
8
+ */
9
+ export interface Thing {
10
+ /**
11
+ * The type of the thing.
12
+ */
13
+ type: string
14
+ /**
15
+ * The name of the thing.
16
+ */
17
+ name: string
18
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { Activity } from './activity'
7
+
8
+ /**
9
+ * Represents expected replies in a conversation.
10
+ */
11
+ export interface ExpectedReplies {
12
+ /**
13
+ * List of activities representing the expected replies.
14
+ */
15
+ activities: Activity[]
16
+ }
package/src/index.ts ADDED
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Export statements for various modules.
8
+ */
9
+ export { ActionTypes } from './action/actionTypes'
10
+ export { CardAction } from './action/cardAction'
11
+ export { SemanticAction } from './action/semanticAction'
12
+ export { SemanticActionStateTypes } from './action/semanticActionStateTypes'
13
+ export { SuggestedActions } from './action/suggestedActions'
14
+
15
+ export { Attachment } from './attachment/attachment'
16
+ export { AttachmentLayoutTypes } from './attachment/attachmentLayoutTypes'
17
+
18
+ export { ChannelAccount } from './conversation/channelAccount'
19
+ export { Channels } from './conversation/channels'
20
+ export { ConversationAccount } from './conversation/conversationAccount'
21
+ export { ConversationReference } from './conversation/conversationReference'
22
+ export { EndOfConversationCodes } from './conversation/endOfConversationCodes'
23
+ export { RoleTypes } from './conversation/roleTypes'
24
+
25
+ export { Entity } from './entity/entity'
26
+ export { Mention } from './entity/mention'
27
+ export { GeoCoordinates } from './entity/geoCoordinates'
28
+ export { Place } from './entity/place'
29
+ export { Thing } from './entity/thing'
30
+
31
+ export * from './invoke/adaptiveCardInvokeAction'
32
+
33
+ export { Activity, activityZodSchema } from './activity'
34
+ export { ActivityEventNames } from './activityEventNames'
35
+ export { ActivityImportance } from './activityImportance'
36
+ export { ActivityTypes } from './activityTypes'
37
+ export { CallerIdConstants } from './callerIdConstants'
38
+ export { DeliveryModes } from './deliveryModes'
39
+ export { ExpectedReplies } from './expectedReplies'
40
+ export { InputHints } from './inputHints'
41
+ export { MessageReaction } from './messageReaction'
42
+ export { MessageReactionTypes } from './messageReactionTypes'
43
+ export { TextFormatTypes } from './textFormatTypes'
44
+ export { TextHighlight } from './textHighlight'
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+
8
+ /**
9
+ * Enum representing input hints.
10
+ */
11
+ export enum InputHints {
12
+ AcceptingInput = 'acceptingInput',
13
+ IgnoringInput = 'ignoringInput',
14
+ ExpectingInput = 'expectingInput',
15
+ }
16
+
17
+ /**
18
+ * Zod schema for validating an InputHints enum.
19
+ */
20
+ export const inputHintsZodSchema = z.enum(['acceptingInput', 'ignoringInput', 'expectingInput'])
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+
8
+ /**
9
+ * Interface representing an adaptive card invoke action.
10
+ */
11
+ export interface AdaptiveCardInvokeAction {
12
+ /**
13
+ * The type of the action.
14
+ */
15
+ type: string
16
+ /**
17
+ * The unique identifier of the action.
18
+ */
19
+ id?: string
20
+ /**
21
+ * The verb associated with the action.
22
+ */
23
+ verb: string
24
+ /**
25
+ * Additional data associated with the action.
26
+ */
27
+ data: Record<string, any>
28
+ }
29
+
30
+ /**
31
+ * Zod schema for validating an adaptive card invoke action.
32
+ */
33
+ export const adaptiveCardInvokeActionZodSchema = z.object({
34
+ type: z.string().min(1),
35
+ id: z.string().optional(),
36
+ verb: z.string().min(1),
37
+ data: z.record(z.string().min(1), z.any())
38
+ })
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+ import { MessageReactionTypes, messageReactionTypesZodSchema } from './messageReactionTypes'
8
+
9
+ /**
10
+ * Represents a message reaction.
11
+ */
12
+ export interface MessageReaction {
13
+ /**
14
+ * The type of the reaction.
15
+ */
16
+ type: MessageReactionTypes | string
17
+ }
18
+
19
+ /**
20
+ * Zod schema for validating a MessageReaction object.
21
+ */
22
+ export const messageReactionZodSchema = z.object({
23
+ type: z.union([messageReactionTypesZodSchema, z.string().min(1)])
24
+ })
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+
8
+ /**
9
+ * Enum representing message reaction types.
10
+ */
11
+ export enum MessageReactionTypes {
12
+ Like = 'like',
13
+ PlusOne = 'plusOne',
14
+ }
15
+
16
+ /**
17
+ * Zod schema for validating MessageReactionTypes enum values.
18
+ */
19
+ export const messageReactionTypesZodSchema = z.enum(['like', 'plusOne'])
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+
8
+ /**
9
+ * Enum representing text format types.
10
+ */
11
+ export enum TextFormatTypes {
12
+ Markdown = 'markdown',
13
+ Plain = 'plain',
14
+ Xml = 'xml',
15
+ }
16
+
17
+ /**
18
+ * Zod schema for validating TextFormatTypes enum values.
19
+ */
20
+ export const textFormatTypesZodSchema = z.enum(['markdown', 'plain', 'xml'])
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { z } from 'zod'
7
+
8
+ /**
9
+ * Interface representing a text highlight.
10
+ */
11
+ export interface TextHighlight {
12
+ /**
13
+ * The highlighted text.
14
+ */
15
+ text: string
16
+ /**
17
+ * The occurrence count of the highlighted text.
18
+ */
19
+ occurrence: number
20
+ }
21
+
22
+ /**
23
+ * Zod schema for validating TextHighlight objects.
24
+ */
25
+ export const textHighlightZodSchema = z.object({
26
+ text: z.string().min(1),
27
+ occurrence: z.number()
28
+ })