@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
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # @microsoft/agents-activity
2
+
3
+ ## Overview
4
+
5
+ The `@microsoft/agents-activity` implements the Activity Protocol Specification https://github.com/microsoft/Agents/blob/main/specs/activity/protocol-activity.md.
6
+
7
+ It provides declaration files defined with TypeScript and validators based on `zod`.
8
+
9
+ ## Installation
10
+
11
+ To install the package, use npm:
12
+
13
+ ```sh
14
+ npm install @microsoft/agents-activity
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```ts
20
+ const activity = Activity.fromObject({ type: ActivityTypes.Message, text: 'Hello World' })
21
+ ```
22
+
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { z } from 'zod';
6
+ /**
7
+ * Enum representing the types of actions.
8
+ */
9
+ export declare enum ActionTypes {
10
+ OpenUrl = "openUrl",
11
+ ImBack = "imBack",
12
+ PostBack = "postBack",
13
+ PlayAudio = "playAudio",
14
+ PlayVideo = "playVideo",
15
+ ShowImage = "showImage",
16
+ DownloadFile = "downloadFile",
17
+ Signin = "signin",
18
+ Call = "call",
19
+ MessageBack = "messageBack",
20
+ OpenApp = "openApp"
21
+ }
22
+ /**
23
+ * Zod schema for validating ActionTypes.
24
+ */
25
+ export declare const actionTypesZodSchema: z.ZodEnum<["openUrl", "imBack", "postBack", "playAudio", "showImage", "downloadFile", "signin", "call", "messageBack", "openApp"]>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright(c) Microsoft Corporation.All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.actionTypesZodSchema = exports.ActionTypes = void 0;
8
+ const zod_1 = require("zod");
9
+ /**
10
+ * Enum representing the types of actions.
11
+ */
12
+ var ActionTypes;
13
+ (function (ActionTypes) {
14
+ ActionTypes["OpenUrl"] = "openUrl";
15
+ ActionTypes["ImBack"] = "imBack";
16
+ ActionTypes["PostBack"] = "postBack";
17
+ ActionTypes["PlayAudio"] = "playAudio";
18
+ ActionTypes["PlayVideo"] = "playVideo";
19
+ ActionTypes["ShowImage"] = "showImage";
20
+ ActionTypes["DownloadFile"] = "downloadFile";
21
+ ActionTypes["Signin"] = "signin";
22
+ ActionTypes["Call"] = "call";
23
+ ActionTypes["MessageBack"] = "messageBack";
24
+ ActionTypes["OpenApp"] = "openApp";
25
+ })(ActionTypes || (exports.ActionTypes = ActionTypes = {}));
26
+ /**
27
+ * Zod schema for validating ActionTypes.
28
+ */
29
+ exports.actionTypesZodSchema = zod_1.z.enum(['openUrl', 'imBack', 'postBack', 'playAudio', 'showImage', 'downloadFile', 'signin', 'call', 'messageBack', 'openApp']);
30
+ //# sourceMappingURL=actionTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actionTypes.js","sourceRoot":"","sources":["../../../src/action/actionTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAEvB;;GAEG;AACH,IAAY,WAYX;AAZD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,sCAAuB,CAAA;IACvB,sCAAuB,CAAA;IACvB,4CAA6B,CAAA;IAC7B,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;AACrB,CAAC,EAZW,WAAW,2BAAX,WAAW,QAYtB;AAED;;GAEG;AACU,QAAA,oBAAoB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAA"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { z } from 'zod';
6
+ import { ActionTypes } from './actionTypes';
7
+ /**
8
+ * Interface representing a card action.
9
+ */
10
+ export interface CardAction {
11
+ /**
12
+ * Type of the action.
13
+ */
14
+ type: ActionTypes | string;
15
+ /**
16
+ * Title of the action.
17
+ */
18
+ title: string;
19
+ /**
20
+ * URL of the image associated with the action.
21
+ */
22
+ image?: string;
23
+ /**
24
+ * Text associated with the action.
25
+ */
26
+ text?: string;
27
+ /**
28
+ * Display text for the action.
29
+ */
30
+ displayText?: string;
31
+ /**
32
+ * Value associated with the action.
33
+ */
34
+ value?: any;
35
+ /**
36
+ * Channel-specific data associated with the action.
37
+ */
38
+ channelData?: unknown;
39
+ /**
40
+ * Alt text for the image.
41
+ */
42
+ imageAltText?: string;
43
+ }
44
+ /**
45
+ * Zod schema for validating CardAction.
46
+ */
47
+ export declare const cardActionZodSchema: z.ZodObject<{
48
+ type: z.ZodUnion<[z.ZodEnum<["openUrl", "imBack", "postBack", "playAudio", "showImage", "downloadFile", "signin", "call", "messageBack", "openApp"]>, z.ZodString]>;
49
+ title: z.ZodString;
50
+ image: z.ZodOptional<z.ZodString>;
51
+ text: z.ZodOptional<z.ZodString>;
52
+ displayText: z.ZodOptional<z.ZodString>;
53
+ value: z.ZodOptional<z.ZodAny>;
54
+ channelData: z.ZodOptional<z.ZodUnknown>;
55
+ imageAltText: z.ZodOptional<z.ZodString>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ type: string;
58
+ title: string;
59
+ value?: any;
60
+ image?: string | undefined;
61
+ text?: string | undefined;
62
+ displayText?: string | undefined;
63
+ channelData?: unknown;
64
+ imageAltText?: string | undefined;
65
+ }, {
66
+ type: string;
67
+ title: string;
68
+ value?: any;
69
+ image?: string | undefined;
70
+ text?: string | undefined;
71
+ displayText?: string | undefined;
72
+ channelData?: unknown;
73
+ imageAltText?: string | undefined;
74
+ }>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.cardActionZodSchema = void 0;
8
+ const zod_1 = require("zod");
9
+ const actionTypes_1 = require("./actionTypes");
10
+ /**
11
+ * Zod schema for validating CardAction.
12
+ */
13
+ exports.cardActionZodSchema = zod_1.z.object({
14
+ type: zod_1.z.union([actionTypes_1.actionTypesZodSchema, zod_1.z.string().min(1)]),
15
+ title: zod_1.z.string().min(1),
16
+ image: zod_1.z.string().min(1).optional(),
17
+ text: zod_1.z.string().min(1).optional(),
18
+ displayText: zod_1.z.string().min(1).optional(),
19
+ value: zod_1.z.any().optional(),
20
+ channelData: zod_1.z.unknown().optional(),
21
+ imageAltText: zod_1.z.string().min(1).optional()
22
+ });
23
+ //# sourceMappingURL=cardAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardAction.js","sourceRoot":"","sources":["../../../src/action/cardAction.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AACvB,+CAAiE;AAwCjE;;GAEG;AACU,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,kCAAoB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAClC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzC,KAAK,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACzB,WAAW,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAA"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { z } from 'zod';
6
+ import { Entity } from '../entity/entity';
7
+ import { SemanticActionStateTypes } from './semanticActionStateTypes';
8
+ /**
9
+ * Interface representing a semantic action.
10
+ */
11
+ export interface SemanticAction {
12
+ /**
13
+ * Unique identifier for the semantic action.
14
+ */
15
+ id: string;
16
+ /**
17
+ * State of the semantic action.
18
+ */
19
+ state: SemanticActionStateTypes | string;
20
+ /**
21
+ * Entities associated with the semantic action.
22
+ */
23
+ entities: {
24
+ [propertyName: string]: Entity;
25
+ };
26
+ }
27
+ /**
28
+ * Zod schema for validating SemanticAction.
29
+ */
30
+ export declare const semanticActionZodSchema: z.ZodObject<{
31
+ id: z.ZodString;
32
+ state: z.ZodUnion<[z.ZodEnum<["start", "continue", "done"]>, z.ZodString]>;
33
+ entities: z.ZodRecord<z.ZodString, z.ZodObject<{
34
+ type: z.ZodString;
35
+ }, "strip", z.ZodTypeAny, {
36
+ type: string;
37
+ }, {
38
+ type: string;
39
+ }>>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ id: string;
42
+ state: string;
43
+ entities: Record<string, {
44
+ type: string;
45
+ }>;
46
+ }, {
47
+ id: string;
48
+ state: string;
49
+ entities: Record<string, {
50
+ type: string;
51
+ }>;
52
+ }>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.semanticActionZodSchema = void 0;
8
+ const zod_1 = require("zod");
9
+ const entity_1 = require("../entity/entity");
10
+ const semanticActionStateTypes_1 = require("./semanticActionStateTypes");
11
+ /**
12
+ * Zod schema for validating SemanticAction.
13
+ */
14
+ exports.semanticActionZodSchema = zod_1.z.object({
15
+ id: zod_1.z.string().min(1),
16
+ state: zod_1.z.union([semanticActionStateTypes_1.semanticActionStateTypesZodSchema, zod_1.z.string().min(1)]),
17
+ entities: zod_1.z.record(entity_1.entityZodSchema)
18
+ });
19
+ //# sourceMappingURL=semanticAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semanticAction.js","sourceRoot":"","sources":["../../../src/action/semanticAction.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AACvB,6CAA0D;AAC1D,yEAAwG;AAoBxG;;GAEG;AACU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,4DAAiC,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,wBAAe,CAAC;CACpC,CAAC,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright(c) Microsoft Corporation.All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { z } from 'zod';
6
+ /**
7
+ * Enum representing the state types of a semantic action.
8
+ */
9
+ export declare enum SemanticActionStateTypes {
10
+ Start = "start",
11
+ Continue = "continue",
12
+ Done = "done"
13
+ }
14
+ /**
15
+ * Zod schema for validating SemanticActionStateTypes.
16
+ */
17
+ export declare const semanticActionStateTypesZodSchema: z.ZodEnum<["start", "continue", "done"]>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright(c) Microsoft Corporation.All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.semanticActionStateTypesZodSchema = exports.SemanticActionStateTypes = void 0;
8
+ const zod_1 = require("zod");
9
+ /**
10
+ * Enum representing the state types of a semantic action.
11
+ */
12
+ var SemanticActionStateTypes;
13
+ (function (SemanticActionStateTypes) {
14
+ SemanticActionStateTypes["Start"] = "start";
15
+ SemanticActionStateTypes["Continue"] = "continue";
16
+ SemanticActionStateTypes["Done"] = "done";
17
+ })(SemanticActionStateTypes || (exports.SemanticActionStateTypes = SemanticActionStateTypes = {}));
18
+ /**
19
+ * Zod schema for validating SemanticActionStateTypes.
20
+ */
21
+ exports.semanticActionStateTypesZodSchema = zod_1.z.enum(['start', 'continue', 'done']);
22
+ //# sourceMappingURL=semanticActionStateTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semanticActionStateTypes.js","sourceRoot":"","sources":["../../../src/action/semanticActionStateTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAEvB;;GAEG;AACH,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,2CAAe,CAAA;IACf,iDAAqB,CAAA;IACrB,yCAAa,CAAA;AACf,CAAC,EAJW,wBAAwB,wCAAxB,wBAAwB,QAInC;AAED;;GAEG;AACU,QAAA,iCAAiC,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { z } from 'zod';
6
+ import { CardAction } from './cardAction';
7
+ /**
8
+ * Interface representing suggested actions.
9
+ */
10
+ export interface SuggestedActions {
11
+ /**
12
+ * Array of recipient IDs.
13
+ */
14
+ to: string[];
15
+ /**
16
+ * Array of card actions.
17
+ */
18
+ actions: CardAction[];
19
+ }
20
+ /**
21
+ * Zod schema for validating SuggestedActions.
22
+ */
23
+ export declare const suggestedActionsZodSchema: z.ZodObject<{
24
+ to: z.ZodArray<z.ZodString, "many">;
25
+ actions: z.ZodArray<z.ZodObject<{
26
+ type: z.ZodUnion<[z.ZodEnum<["openUrl", "imBack", "postBack", "playAudio", "showImage", "downloadFile", "signin", "call", "messageBack", "openApp"]>, z.ZodString]>;
27
+ title: z.ZodString;
28
+ image: z.ZodOptional<z.ZodString>;
29
+ text: z.ZodOptional<z.ZodString>;
30
+ displayText: z.ZodOptional<z.ZodString>;
31
+ value: z.ZodOptional<z.ZodAny>;
32
+ channelData: z.ZodOptional<z.ZodUnknown>;
33
+ imageAltText: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ type: string;
36
+ title: string;
37
+ value?: any;
38
+ image?: string | undefined;
39
+ text?: string | undefined;
40
+ displayText?: string | undefined;
41
+ channelData?: unknown;
42
+ imageAltText?: string | undefined;
43
+ }, {
44
+ type: string;
45
+ title: string;
46
+ value?: any;
47
+ image?: string | undefined;
48
+ text?: string | undefined;
49
+ displayText?: string | undefined;
50
+ channelData?: unknown;
51
+ imageAltText?: string | undefined;
52
+ }>, "many">;
53
+ }, "strip", z.ZodTypeAny, {
54
+ to: string[];
55
+ actions: {
56
+ type: string;
57
+ title: string;
58
+ value?: any;
59
+ image?: string | undefined;
60
+ text?: string | undefined;
61
+ displayText?: string | undefined;
62
+ channelData?: unknown;
63
+ imageAltText?: string | undefined;
64
+ }[];
65
+ }, {
66
+ to: string[];
67
+ actions: {
68
+ type: string;
69
+ title: string;
70
+ value?: any;
71
+ image?: string | undefined;
72
+ text?: string | undefined;
73
+ displayText?: string | undefined;
74
+ channelData?: unknown;
75
+ imageAltText?: string | undefined;
76
+ }[];
77
+ }>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.suggestedActionsZodSchema = void 0;
8
+ const zod_1 = require("zod");
9
+ const cardAction_1 = require("./cardAction");
10
+ /**
11
+ * Zod schema for validating SuggestedActions.
12
+ */
13
+ exports.suggestedActionsZodSchema = zod_1.z.object({
14
+ to: zod_1.z.array(zod_1.z.string().min(1)),
15
+ actions: zod_1.z.array(cardAction_1.cardActionZodSchema)
16
+ });
17
+ //# sourceMappingURL=suggestedActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestedActions.js","sourceRoot":"","sources":["../../../src/action/suggestedActions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AACvB,6CAA8D;AAgB9D;;GAEG;AACU,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,EAAE,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,gCAAmB,CAAC;CACtC,CAAC,CAAA"}