@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.
- package/README.md +22 -0
- package/dist/src/action/actionTypes.d.ts +25 -0
- package/dist/src/action/actionTypes.js +30 -0
- package/dist/src/action/actionTypes.js.map +1 -0
- package/dist/src/action/cardAction.d.ts +74 -0
- package/dist/src/action/cardAction.js +23 -0
- package/dist/src/action/cardAction.js.map +1 -0
- package/dist/src/action/semanticAction.d.ts +52 -0
- package/dist/src/action/semanticAction.js +19 -0
- package/dist/src/action/semanticAction.js.map +1 -0
- package/dist/src/action/semanticActionStateTypes.d.ts +17 -0
- package/dist/src/action/semanticActionStateTypes.js +22 -0
- package/dist/src/action/semanticActionStateTypes.js.map +1 -0
- package/dist/src/action/suggestedActions.d.ts +77 -0
- package/dist/src/action/suggestedActions.js +17 -0
- package/dist/src/action/suggestedActions.js.map +1 -0
- package/dist/src/activity.d.ts +811 -0
- package/dist/src/activity.js +264 -0
- package/dist/src/activity.js.map +1 -0
- package/dist/src/activityEventNames.d.ts +16 -0
- package/dist/src/activityEventNames.js +21 -0
- package/dist/src/activityEventNames.js.map +1 -0
- package/dist/src/activityImportance.d.ts +17 -0
- package/dist/src/activityImportance.js +22 -0
- package/dist/src/activityImportance.js.map +1 -0
- package/dist/src/activityTypes.d.ts +33 -0
- package/dist/src/activityTypes.js +58 -0
- package/dist/src/activityTypes.js.map +1 -0
- package/dist/src/attachment/attachment.d.ts +37 -0
- package/dist/src/attachment/attachment.js +19 -0
- package/dist/src/attachment/attachment.js.map +1 -0
- package/dist/src/attachment/attachmentLayoutTypes.d.ts +16 -0
- package/dist/src/attachment/attachmentLayoutTypes.js +21 -0
- package/dist/src/attachment/attachmentLayoutTypes.js.map +1 -0
- package/dist/src/callerIdConstants.d.ts +21 -0
- package/dist/src/callerIdConstants.js +25 -0
- package/dist/src/callerIdConstants.js.map +1 -0
- package/dist/src/conversation/channelAccount.d.ts +38 -0
- package/dist/src/conversation/channelAccount.js +20 -0
- package/dist/src/conversation/channelAccount.js.map +1 -0
- package/dist/src/conversation/channels.d.ts +28 -0
- package/dist/src/conversation/channels.js +33 -0
- package/dist/src/conversation/channels.js.map +1 -0
- package/dist/src/conversation/conversationAccount.d.ts +50 -0
- package/dist/src/conversation/conversationAccount.js +23 -0
- package/dist/src/conversation/conversationAccount.js.map +1 -0
- package/dist/src/conversation/conversationReference.d.ts +152 -0
- package/dist/src/conversation/conversationReference.js +23 -0
- package/dist/src/conversation/conversationReference.js.map +1 -0
- package/dist/src/conversation/endOfConversationCodes.d.ts +20 -0
- package/dist/src/conversation/endOfConversationCodes.js +25 -0
- package/dist/src/conversation/endOfConversationCodes.js.map +1 -0
- package/dist/src/conversation/roleTypes.d.ts +17 -0
- package/dist/src/conversation/roleTypes.js +22 -0
- package/dist/src/conversation/roleTypes.js.map +1 -0
- package/dist/src/deliveryModes.d.ts +18 -0
- package/dist/src/deliveryModes.js +23 -0
- package/dist/src/deliveryModes.js.map +1 -0
- package/dist/src/entity/entity.d.ts +28 -0
- package/dist/src/entity/entity.js +15 -0
- package/dist/src/entity/entity.js.map +1 -0
- package/dist/src/entity/geoCoordinates.d.ts +29 -0
- package/dist/src/entity/geoCoordinates.js +7 -0
- package/dist/src/entity/geoCoordinates.js.map +1 -0
- package/dist/src/entity/mention.d.ts +22 -0
- package/dist/src/entity/mention.js +7 -0
- package/dist/src/entity/mention.js.map +1 -0
- package/dist/src/entity/place.d.ts +29 -0
- package/dist/src/entity/place.js +7 -0
- package/dist/src/entity/place.js.map +1 -0
- package/dist/src/entity/thing.d.ts +17 -0
- package/dist/src/entity/thing.js +7 -0
- package/dist/src/entity/thing.js.map +1 -0
- package/dist/src/expectedReplies.d.ts +14 -0
- package/dist/src/expectedReplies.js +7 -0
- package/dist/src/expectedReplies.js.map +1 -0
- package/dist/src/index.d.ts +38 -0
- package/dist/src/index.js +57 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/inputHints.d.ts +17 -0
- package/dist/src/inputHints.js +22 -0
- package/dist/src/inputHints.js.map +1 -0
- package/dist/src/invoke/adaptiveCardInvokeAction.d.ts +45 -0
- package/dist/src/invoke/adaptiveCardInvokeAction.js +18 -0
- package/dist/src/invoke/adaptiveCardInvokeAction.js.map +1 -0
- package/dist/src/messageReaction.d.ts +25 -0
- package/dist/src/messageReaction.js +16 -0
- package/dist/src/messageReaction.js.map +1 -0
- package/dist/src/messageReactionTypes.d.ts +16 -0
- package/dist/src/messageReactionTypes.js +21 -0
- package/dist/src/messageReactionTypes.js.map +1 -0
- package/dist/src/textFormatTypes.d.ts +17 -0
- package/dist/src/textFormatTypes.js +22 -0
- package/dist/src/textFormatTypes.js.map +1 -0
- package/dist/src/textHighlight.d.ts +31 -0
- package/dist/src/textHighlight.js +16 -0
- package/dist/src/textHighlight.js.map +1 -0
- package/package.json +44 -0
- package/src/action/actionTypes.ts +28 -0
- package/src/action/cardAction.ts +59 -0
- package/src/action/semanticAction.ts +35 -0
- package/src/action/semanticActionStateTypes.ts +20 -0
- package/src/action/suggestedActions.ts +29 -0
- package/src/activity.ts +334 -0
- package/src/activityEventNames.ts +19 -0
- package/src/activityImportance.ts +20 -0
- package/src/activityTypes.ts +56 -0
- package/src/attachment/attachment.ts +28 -0
- package/src/attachment/attachmentLayoutTypes.ts +19 -0
- package/src/callerIdConstants.ts +22 -0
- package/src/conversation/channelAccount.ts +29 -0
- package/src/conversation/channels.ts +29 -0
- package/src/conversation/conversationAccount.ts +35 -0
- package/src/conversation/conversationReference.ts +34 -0
- package/src/conversation/endOfConversationCodes.ts +23 -0
- package/src/conversation/roleTypes.ts +20 -0
- package/src/deliveryModes.ts +21 -0
- package/src/entity/entity.ts +27 -0
- package/src/entity/geoCoordinates.ts +30 -0
- package/src/entity/mention.ts +24 -0
- package/src/entity/place.ts +30 -0
- package/src/entity/thing.ts +18 -0
- package/src/expectedReplies.ts +16 -0
- package/src/index.ts +44 -0
- package/src/inputHints.ts +20 -0
- package/src/invoke/adaptiveCardInvokeAction.ts +38 -0
- package/src/messageReaction.ts +24 -0
- package/src/messageReactionTypes.ts +19 -0
- package/src/textFormatTypes.ts +20 -0
- 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
|
+
})
|