@microsoft/agents-hosting 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 +57 -0
- package/dist/src/activityHandler.d.ts +108 -0
- package/dist/src/activityHandler.js +395 -0
- package/dist/src/activityHandler.js.map +1 -0
- package/dist/src/agent-client/agentClient.d.ts +13 -0
- package/dist/src/agent-client/agentClient.js +75 -0
- package/dist/src/agent-client/agentClient.js.map +1 -0
- package/dist/src/agent-client/expressApi.d.ts +4 -0
- package/dist/src/agent-client/expressApi.js +50 -0
- package/dist/src/agent-client/expressApi.js.map +1 -0
- package/dist/src/agent-client/index.d.ts +2 -0
- package/dist/src/agent-client/index.js +19 -0
- package/dist/src/agent-client/index.js.map +1 -0
- package/dist/src/app/agentApplication.d.ts +47 -0
- package/dist/src/app/agentApplication.js +317 -0
- package/dist/src/app/agentApplication.js.map +1 -0
- package/dist/src/app/appRoute.d.ts +11 -0
- package/dist/src/app/appRoute.js +7 -0
- package/dist/src/app/appRoute.js.map +1 -0
- package/dist/src/app/applicationBuilder.d.ts +18 -0
- package/dist/src/app/applicationBuilder.js +37 -0
- package/dist/src/app/applicationBuilder.js.map +1 -0
- package/dist/src/app/applicationOptions.d.ts +19 -0
- package/dist/src/app/applicationOptions.js +7 -0
- package/dist/src/app/applicationOptions.js.map +1 -0
- package/dist/src/app/attachmentDownloader.d.ts +13 -0
- package/dist/src/app/attachmentDownloader.js +72 -0
- package/dist/src/app/attachmentDownloader.js.map +1 -0
- package/dist/src/app/conversationUpdateEvents.d.ts +5 -0
- package/dist/src/app/conversationUpdateEvents.js +7 -0
- package/dist/src/app/conversationUpdateEvents.js.map +1 -0
- package/dist/src/app/index.d.ts +10 -0
- package/dist/src/app/index.js +27 -0
- package/dist/src/app/index.js.map +1 -0
- package/dist/src/app/inputFileDownloader.d.ts +14 -0
- package/dist/src/app/inputFileDownloader.js +7 -0
- package/dist/src/app/inputFileDownloader.js.map +1 -0
- package/dist/src/app/memory.d.ts +10 -0
- package/dist/src/app/memory.js +7 -0
- package/dist/src/app/memory.js.map +1 -0
- package/dist/src/app/oauth/authenticationOptions.d.ts +7 -0
- package/dist/src/app/oauth/authenticationOptions.js +7 -0
- package/dist/src/app/oauth/authenticationOptions.js.map +1 -0
- package/dist/src/app/oauth/webChatOAuthFlowAppStyle.d.ts +11 -0
- package/dist/src/app/oauth/webChatOAuthFlowAppStyle.js +85 -0
- package/dist/src/app/oauth/webChatOAuthFlowAppStyle.js.map +1 -0
- package/dist/src/app/routeHandler.d.ts +7 -0
- package/dist/src/app/routeHandler.js +7 -0
- package/dist/src/app/routeHandler.js.map +1 -0
- package/dist/src/app/routeSelector.d.ts +7 -0
- package/dist/src/app/routeSelector.js +7 -0
- package/dist/src/app/routeSelector.js.map +1 -0
- package/dist/src/app/turnEvents.d.ts +5 -0
- package/dist/src/app/turnEvents.js +7 -0
- package/dist/src/app/turnEvents.js.map +1 -0
- package/dist/src/app/turnState.d.ts +85 -0
- package/dist/src/app/turnState.js +274 -0
- package/dist/src/app/turnState.js.map +1 -0
- package/dist/src/app/turnStateEntry.d.ts +17 -0
- package/dist/src/app/turnStateEntry.js +39 -0
- package/dist/src/app/turnStateEntry.js.map +1 -0
- package/dist/src/auth/authConfiguration.d.ts +29 -0
- package/dist/src/auth/authConfiguration.js +58 -0
- package/dist/src/auth/authConfiguration.js.map +1 -0
- package/dist/src/auth/authProvider.d.ts +17 -0
- package/dist/src/auth/authProvider.js +7 -0
- package/dist/src/auth/authProvider.js.map +1 -0
- package/dist/src/auth/index.d.ts +4 -0
- package/dist/src/auth/index.js +21 -0
- package/dist/src/auth/index.js.map +1 -0
- package/dist/src/auth/jwt-middleware.d.ts +13 -0
- package/dist/src/auth/jwt-middleware.js +97 -0
- package/dist/src/auth/jwt-middleware.js.map +1 -0
- package/dist/src/auth/msalTokenProvider.d.ts +53 -0
- package/dist/src/auth/msalTokenProvider.js +198 -0
- package/dist/src/auth/msalTokenProvider.js.map +1 -0
- package/dist/src/auth/request.d.ts +15 -0
- package/dist/src/auth/request.js +7 -0
- package/dist/src/auth/request.js.map +1 -0
- package/dist/src/baseAdapter.d.ts +88 -0
- package/dist/src/baseAdapter.js +94 -0
- package/dist/src/baseAdapter.js.map +1 -0
- package/dist/src/cards/animationCard.d.ts +36 -0
- package/dist/src/cards/animationCard.js +7 -0
- package/dist/src/cards/animationCard.js.map +1 -0
- package/dist/src/cards/audioCard.d.ts +36 -0
- package/dist/src/cards/audioCard.js +7 -0
- package/dist/src/cards/audioCard.js.map +1 -0
- package/dist/src/cards/cardFactory.d.ts +123 -0
- package/dist/src/cards/cardFactory.js +225 -0
- package/dist/src/cards/cardFactory.js.map +1 -0
- package/dist/src/cards/cardImage.d.ts +16 -0
- package/dist/src/cards/cardImage.js +7 -0
- package/dist/src/cards/cardImage.js.map +1 -0
- package/dist/src/cards/fact.d.ts +13 -0
- package/dist/src/cards/fact.js +7 -0
- package/dist/src/cards/fact.js.map +1 -0
- package/dist/src/cards/heroCard.d.ts +23 -0
- package/dist/src/cards/heroCard.js +7 -0
- package/dist/src/cards/heroCard.js.map +1 -0
- package/dist/src/cards/index.d.ts +17 -0
- package/dist/src/cards/index.js +34 -0
- package/dist/src/cards/index.js.map +1 -0
- package/dist/src/cards/mediaUrl.d.ts +17 -0
- package/dist/src/cards/mediaUrl.js +7 -0
- package/dist/src/cards/mediaUrl.js.map +1 -0
- package/dist/src/cards/o365ConnectorCard.d.ts +35 -0
- package/dist/src/cards/o365ConnectorCard.js +7 -0
- package/dist/src/cards/o365ConnectorCard.js.map +1 -0
- package/dist/src/cards/o365ConnectorCardActionBase.d.ts +22 -0
- package/dist/src/cards/o365ConnectorCardActionBase.js +7 -0
- package/dist/src/cards/o365ConnectorCardActionBase.js.map +1 -0
- package/dist/src/cards/o365ConnectorCardFact.d.ts +17 -0
- package/dist/src/cards/o365ConnectorCardFact.js +7 -0
- package/dist/src/cards/o365ConnectorCardFact.js.map +1 -0
- package/dist/src/cards/o365ConnectorCardImage.d.ts +17 -0
- package/dist/src/cards/o365ConnectorCardImage.js +7 -0
- package/dist/src/cards/o365ConnectorCardImage.js.map +1 -0
- package/dist/src/cards/o365ConnectorCardSection.d.ts +57 -0
- package/dist/src/cards/o365ConnectorCardSection.js +7 -0
- package/dist/src/cards/o365ConnectorCardSection.js.map +1 -0
- package/dist/src/cards/receiptCard.d.ts +44 -0
- package/dist/src/cards/receiptCard.js +7 -0
- package/dist/src/cards/receiptCard.js.map +1 -0
- package/dist/src/cards/receiptItem.d.ts +39 -0
- package/dist/src/cards/receiptItem.js +7 -0
- package/dist/src/cards/receiptItem.js.map +1 -0
- package/dist/src/cards/signinCard.d.ts +14 -0
- package/dist/src/cards/signinCard.js +5 -0
- package/dist/src/cards/signinCard.js.map +1 -0
- package/dist/src/cards/taskModuleAction.d.ts +43 -0
- package/dist/src/cards/taskModuleAction.js +30 -0
- package/dist/src/cards/taskModuleAction.js.map +1 -0
- package/dist/src/cards/thumbnailCard.d.ts +35 -0
- package/dist/src/cards/thumbnailCard.js +7 -0
- package/dist/src/cards/thumbnailCard.js.map +1 -0
- package/dist/src/cards/thumbnailUrl.d.ts +17 -0
- package/dist/src/cards/thumbnailUrl.js +7 -0
- package/dist/src/cards/thumbnailUrl.js.map +1 -0
- package/dist/src/cards/videoCard.d.ts +60 -0
- package/dist/src/cards/videoCard.js +7 -0
- package/dist/src/cards/videoCard.js.map +1 -0
- package/dist/src/claimsIdentity.d.ts +35 -0
- package/dist/src/claimsIdentity.js +43 -0
- package/dist/src/claimsIdentity.js.map +1 -0
- package/dist/src/cloudAdapter.d.ts +128 -0
- package/dist/src/cloudAdapter.js +376 -0
- package/dist/src/cloudAdapter.js.map +1 -0
- package/dist/src/connector-client/attachmentData.d.ts +25 -0
- package/dist/src/connector-client/attachmentData.js +7 -0
- package/dist/src/connector-client/attachmentData.js.map +1 -0
- package/dist/src/connector-client/attachmentInfo.d.ts +22 -0
- package/dist/src/connector-client/attachmentInfo.js +7 -0
- package/dist/src/connector-client/attachmentInfo.js.map +1 -0
- package/dist/src/connector-client/attachmentView.d.ts +17 -0
- package/dist/src/connector-client/attachmentView.js +7 -0
- package/dist/src/connector-client/attachmentView.js.map +1 -0
- package/dist/src/connector-client/connectorClient.d.ts +93 -0
- package/dist/src/connector-client/connectorClient.js +249 -0
- package/dist/src/connector-client/connectorClient.js.map +1 -0
- package/dist/src/connector-client/conversationMembers.d.ts +18 -0
- package/dist/src/connector-client/conversationMembers.js +7 -0
- package/dist/src/connector-client/conversationMembers.js.map +1 -0
- package/dist/src/connector-client/conversationParameters.d.ts +38 -0
- package/dist/src/connector-client/conversationParameters.js +7 -0
- package/dist/src/connector-client/conversationParameters.js.map +1 -0
- package/dist/src/connector-client/conversationResourceResponse.d.ts +21 -0
- package/dist/src/connector-client/conversationResourceResponse.js +7 -0
- package/dist/src/connector-client/conversationResourceResponse.js.map +1 -0
- package/dist/src/connector-client/conversationsResult.d.ts +18 -0
- package/dist/src/connector-client/conversationsResult.js +7 -0
- package/dist/src/connector-client/conversationsResult.js.map +1 -0
- package/dist/src/connector-client/index.d.ts +9 -0
- package/dist/src/connector-client/index.js +26 -0
- package/dist/src/connector-client/index.js.map +1 -0
- package/dist/src/connector-client/resourceResponse.d.ts +13 -0
- package/dist/src/connector-client/resourceResponse.js +7 -0
- package/dist/src/connector-client/resourceResponse.js.map +1 -0
- package/dist/src/index.d.ts +26 -0
- package/dist/src/index.js +45 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/invoke/adaptiveCardAuthentication.d.ts +10 -0
- package/dist/src/invoke/adaptiveCardAuthentication.js +7 -0
- package/dist/src/invoke/adaptiveCardAuthentication.js.map +1 -0
- package/dist/src/invoke/adaptiveCardInvokeResponse.d.ts +21 -0
- package/dist/src/invoke/adaptiveCardInvokeResponse.js +7 -0
- package/dist/src/invoke/adaptiveCardInvokeResponse.js.map +1 -0
- package/dist/src/invoke/adaptiveCardInvokeValue.d.ts +23 -0
- package/dist/src/invoke/adaptiveCardInvokeValue.js +7 -0
- package/dist/src/invoke/adaptiveCardInvokeValue.js.map +1 -0
- package/dist/src/invoke/index.d.ts +9 -0
- package/dist/src/invoke/index.js +26 -0
- package/dist/src/invoke/index.js.map +1 -0
- package/dist/src/invoke/invokeException.d.ts +24 -0
- package/dist/src/invoke/invokeException.js +35 -0
- package/dist/src/invoke/invokeException.js.map +1 -0
- package/dist/src/invoke/invokeResponse.d.ts +17 -0
- package/dist/src/invoke/invokeResponse.js +7 -0
- package/dist/src/invoke/invokeResponse.js.map +1 -0
- package/dist/src/invoke/searchInvokeOptions.d.ts +17 -0
- package/dist/src/invoke/searchInvokeOptions.js +7 -0
- package/dist/src/invoke/searchInvokeOptions.js.map +1 -0
- package/dist/src/invoke/searchInvokeResponse.d.ts +10 -0
- package/dist/src/invoke/searchInvokeResponse.js +7 -0
- package/dist/src/invoke/searchInvokeResponse.js.map +1 -0
- package/dist/src/invoke/searchInvokeValue.d.ts +26 -0
- package/dist/src/invoke/searchInvokeValue.js +7 -0
- package/dist/src/invoke/searchInvokeValue.js.map +1 -0
- package/dist/src/invoke/tokenExchangeInvokeRequest.d.ts +21 -0
- package/dist/src/invoke/tokenExchangeInvokeRequest.js +7 -0
- package/dist/src/invoke/tokenExchangeInvokeRequest.js.map +1 -0
- package/dist/src/logger.d.ts +12 -0
- package/dist/src/logger.js +42 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/messageFactory.d.ts +62 -0
- package/dist/src/messageFactory.js +143 -0
- package/dist/src/messageFactory.js.map +1 -0
- package/dist/src/middlewareSet.d.ts +43 -0
- package/dist/src/middlewareSet.js +57 -0
- package/dist/src/middlewareSet.js.map +1 -0
- package/dist/src/oauth/index.d.ts +7 -0
- package/dist/src/oauth/index.js +24 -0
- package/dist/src/oauth/index.js.map +1 -0
- package/dist/src/oauth/oauthCard.d.ts +28 -0
- package/dist/src/oauth/oauthCard.js +5 -0
- package/dist/src/oauth/oauthCard.js.map +1 -0
- package/dist/src/oauth/signingResource.d.ts +19 -0
- package/dist/src/oauth/signingResource.js +5 -0
- package/dist/src/oauth/signingResource.js.map +1 -0
- package/dist/src/oauth/tokenExchangeRequest.d.ts +17 -0
- package/dist/src/oauth/tokenExchangeRequest.js +5 -0
- package/dist/src/oauth/tokenExchangeRequest.js.map +1 -0
- package/dist/src/oauth/tokenExchangeResource.d.ts +17 -0
- package/dist/src/oauth/tokenExchangeResource.js +5 -0
- package/dist/src/oauth/tokenExchangeResource.js.map +1 -0
- package/dist/src/oauth/tokenPostResource.d.ts +9 -0
- package/dist/src/oauth/tokenPostResource.js +5 -0
- package/dist/src/oauth/tokenPostResource.js.map +1 -0
- package/dist/src/oauth/userTokenClient.d.ts +49 -0
- package/dist/src/oauth/userTokenClient.js +117 -0
- package/dist/src/oauth/userTokenClient.js.map +1 -0
- package/dist/src/oauth/webChatOAuthFlow.d.ts +41 -0
- package/dist/src/oauth/webChatOAuthFlow.js +117 -0
- package/dist/src/oauth/webChatOAuthFlow.js.map +1 -0
- package/dist/src/state/agentState.d.ts +71 -0
- package/dist/src/state/agentState.js +122 -0
- package/dist/src/state/agentState.js.map +1 -0
- package/dist/src/state/agentStatePropertyAccesor.d.ts +39 -0
- package/dist/src/state/agentStatePropertyAccesor.js +60 -0
- package/dist/src/state/agentStatePropertyAccesor.js.map +1 -0
- package/dist/src/state/conversationState.d.ts +18 -0
- package/dist/src/state/conversationState.js +38 -0
- package/dist/src/state/conversationState.js.map +1 -0
- package/dist/src/state/index.d.ts +4 -0
- package/dist/src/state/index.js +21 -0
- package/dist/src/state/index.js.map +1 -0
- package/dist/src/state/userState.d.ts +18 -0
- package/dist/src/state/userState.js +38 -0
- package/dist/src/state/userState.js.map +1 -0
- package/dist/src/statusCodes.d.ts +19 -0
- package/dist/src/statusCodes.js +24 -0
- package/dist/src/statusCodes.js.map +1 -0
- package/dist/src/storage/index.d.ts +2 -0
- package/dist/src/storage/index.js +19 -0
- package/dist/src/storage/index.js.map +1 -0
- package/dist/src/storage/memoryStorage.d.ts +50 -0
- package/dist/src/storage/memoryStorage.js +100 -0
- package/dist/src/storage/memoryStorage.js.map +1 -0
- package/dist/src/storage/storage.d.ts +47 -0
- package/dist/src/storage/storage.js +7 -0
- package/dist/src/storage/storage.js.map +1 -0
- package/dist/src/tokenResponseEventName.d.ts +5 -0
- package/dist/src/tokenResponseEventName.js +9 -0
- package/dist/src/tokenResponseEventName.js.map +1 -0
- package/dist/src/transcript/consoleTranscriptLogger.d.ts +13 -0
- package/dist/src/transcript/consoleTranscriptLogger.js +21 -0
- package/dist/src/transcript/consoleTranscriptLogger.js.map +1 -0
- package/dist/src/transcript/index.d.ts +4 -0
- package/dist/src/transcript/index.js +21 -0
- package/dist/src/transcript/index.js.map +1 -0
- package/dist/src/transcript/transcriptLogger.d.ts +42 -0
- package/dist/src/transcript/transcriptLogger.js +3 -0
- package/dist/src/transcript/transcriptLogger.js.map +1 -0
- package/dist/src/transcript/transcriptLoggerMiddleware.d.ts +38 -0
- package/dist/src/transcript/transcriptLoggerMiddleware.js +126 -0
- package/dist/src/transcript/transcriptLoggerMiddleware.js.map +1 -0
- package/dist/src/transcript/transcriptStore.d.ts +30 -0
- package/dist/src/transcript/transcriptStore.js +3 -0
- package/dist/src/transcript/transcriptStore.js.map +1 -0
- package/dist/src/turnContext.d.ts +160 -0
- package/dist/src/turnContext.js +286 -0
- package/dist/src/turnContext.js.map +1 -0
- package/dist/src/turnContextStateCollection.d.ts +29 -0
- package/dist/src/turnContextStateCollection.js +56 -0
- package/dist/src/turnContextStateCollection.js.map +1 -0
- package/package.json +48 -0
- package/src/activityHandler.ts +461 -0
- package/src/agent-client/agentClient.ts +84 -0
- package/src/agent-client/expressApi.ts +59 -0
- package/src/agent-client/index.ts +2 -0
- package/src/app/agentApplication.ts +401 -0
- package/src/app/appRoute.ts +13 -0
- package/src/app/applicationBuilder.ts +42 -0
- package/src/app/applicationOptions.ts +21 -0
- package/src/app/attachmentDownloader.ts +83 -0
- package/src/app/conversationUpdateEvents.ts +8 -0
- package/src/app/index.ts +10 -0
- package/src/app/inputFileDownloader.ts +17 -0
- package/src/app/memory.ts +14 -0
- package/src/app/oauth/authenticationOptions.ts +8 -0
- package/src/app/oauth/webChatOAuthFlowAppStyle.ts +90 -0
- package/src/app/routeHandler.ts +9 -0
- package/src/app/routeSelector.ts +10 -0
- package/src/app/turnEvents.ts +6 -0
- package/src/app/turnState.ts +338 -0
- package/src/app/turnStateEntry.ts +46 -0
- package/src/auth/authConfiguration.ts +68 -0
- package/src/auth/authProvider.ts +19 -0
- package/src/auth/index.ts +4 -0
- package/src/auth/jwt-middleware.ts +99 -0
- package/src/auth/msalTokenProvider.ts +202 -0
- package/src/auth/request.ts +20 -0
- package/src/baseAdapter.ts +174 -0
- package/src/cards/animationCard.ts +38 -0
- package/src/cards/audioCard.ts +38 -0
- package/src/cards/cardFactory.ts +276 -0
- package/src/cards/cardImage.ts +18 -0
- package/src/cards/fact.ts +14 -0
- package/src/cards/heroCard.ts +25 -0
- package/src/cards/index.ts +17 -0
- package/src/cards/mediaUrl.ts +18 -0
- package/src/cards/o365ConnectorCard.ts +37 -0
- package/src/cards/o365ConnectorCardActionBase.ts +24 -0
- package/src/cards/o365ConnectorCardFact.ts +18 -0
- package/src/cards/o365ConnectorCardImage.ts +18 -0
- package/src/cards/o365ConnectorCardSection.ts +60 -0
- package/src/cards/receiptCard.ts +46 -0
- package/src/cards/receiptItem.ts +41 -0
- package/src/cards/signinCard.ts +18 -0
- package/src/cards/taskModuleAction.ts +61 -0
- package/src/cards/thumbnailCard.ts +37 -0
- package/src/cards/thumbnailUrl.ts +18 -0
- package/src/cards/videoCard.ts +62 -0
- package/src/claimsIdentity.ts +47 -0
- package/src/cloudAdapter.ts +431 -0
- package/src/connector-client/attachmentData.ts +26 -0
- package/src/connector-client/attachmentInfo.ts +24 -0
- package/src/connector-client/attachmentView.ts +18 -0
- package/src/connector-client/connectorClient.ts +295 -0
- package/src/connector-client/conversationMembers.ts +20 -0
- package/src/connector-client/conversationParameters.ts +40 -0
- package/src/connector-client/conversationResourceResponse.ts +22 -0
- package/src/connector-client/conversationsResult.ts +20 -0
- package/src/connector-client/index.ts +9 -0
- package/src/connector-client/resourceResponse.ts +14 -0
- package/src/index.ts +31 -0
- package/src/invoke/adaptiveCardAuthentication.ts +13 -0
- package/src/invoke/adaptiveCardInvokeResponse.ts +22 -0
- package/src/invoke/adaptiveCardInvokeValue.ts +25 -0
- package/src/invoke/index.ts +9 -0
- package/src/invoke/invokeException.ts +33 -0
- package/src/invoke/invokeResponse.ts +18 -0
- package/src/invoke/searchInvokeOptions.ts +18 -0
- package/src/invoke/searchInvokeResponse.ts +11 -0
- package/src/invoke/searchInvokeValue.ts +28 -0
- package/src/invoke/tokenExchangeInvokeRequest.ts +22 -0
- package/src/logger.ts +43 -0
- package/src/messageFactory.ts +177 -0
- package/src/middlewareSet.ts +76 -0
- package/src/oauth/index.ts +7 -0
- package/src/oauth/oauthCard.ts +32 -0
- package/src/oauth/signingResource.ts +23 -0
- package/src/oauth/tokenExchangeRequest.ts +20 -0
- package/src/oauth/tokenExchangeResource.ts +20 -0
- package/src/oauth/tokenPostResource.ts +12 -0
- package/src/oauth/userTokenClient.ts +116 -0
- package/src/oauth/webChatOAuthFlow.ts +123 -0
- package/src/state/agentState.ts +142 -0
- package/src/state/agentStatePropertyAccesor.ts +61 -0
- package/src/state/conversationState.ts +42 -0
- package/src/state/index.ts +4 -0
- package/src/state/userState.ts +43 -0
- package/src/statusCodes.ts +20 -0
- package/src/storage/index.ts +2 -0
- package/src/storage/memoryStorage.ts +105 -0
- package/src/storage/storage.ts +52 -0
- package/src/tokenResponseEventName.ts +6 -0
- package/src/transcript/consoleTranscriptLogger.ts +20 -0
- package/src/transcript/index.ts +4 -0
- package/src/transcript/transcriptLogger.ts +45 -0
- package/src/transcript/transcriptLoggerMiddleware.ts +151 -0
- package/src/transcript/transcriptStore.ts +38 -0
- package/src/turnContext.ts +335 -0
- package/src/turnContextStateCollection.ts +69 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ActionTypes, Attachment, CardAction } from '@microsoft/agents-activity'
|
|
7
|
+
import { MediaUrl } from './mediaUrl'
|
|
8
|
+
import { AnimationCard } from './animationCard'
|
|
9
|
+
import { AudioCard } from './audioCard'
|
|
10
|
+
import { HeroCard } from './heroCard'
|
|
11
|
+
import { ReceiptCard } from './receiptCard'
|
|
12
|
+
import { O365ConnectorCard } from './o365ConnectorCard'
|
|
13
|
+
import { ThumbnailCard } from './thumbnailCard'
|
|
14
|
+
import { VideoCard } from './videoCard'
|
|
15
|
+
import { CardImage } from './cardImage'
|
|
16
|
+
import { OAuthCard } from '../oauth/oauthCard'
|
|
17
|
+
import { SigningResource } from '../oauth/signingResource'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Factory class for creating various types of cards.
|
|
21
|
+
*/
|
|
22
|
+
export class CardFactory {
|
|
23
|
+
static contentTypes: any = {
|
|
24
|
+
adaptiveCard: 'application/vnd.microsoft.card.adaptive',
|
|
25
|
+
animationCard: 'application/vnd.microsoft.card.animation',
|
|
26
|
+
audioCard: 'application/vnd.microsoft.card.audio',
|
|
27
|
+
heroCard: 'application/vnd.microsoft.card.hero',
|
|
28
|
+
receiptCard: 'application/vnd.microsoft.card.receipt',
|
|
29
|
+
o365ConnectorCard: 'application/vnd.microsoft.teams.card.o365connector',
|
|
30
|
+
thumbnailCard: 'application/vnd.microsoft.card.thumbnail',
|
|
31
|
+
videoCard: 'application/vnd.microsoft.card.video',
|
|
32
|
+
oauthCard: 'application/vnd.microsoft.card.oauth',
|
|
33
|
+
signinCard: 'application/vnd.microsoft.card.signin',
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Creates an adaptive card attachment.
|
|
38
|
+
* @param card The adaptive card content.
|
|
39
|
+
* @returns The adaptive card attachment.
|
|
40
|
+
*/
|
|
41
|
+
static adaptiveCard (card: any): Attachment {
|
|
42
|
+
return { contentType: CardFactory.contentTypes.adaptiveCard, content: card }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Creates an animation card attachment.
|
|
47
|
+
* @param title The title of the card.
|
|
48
|
+
* @param media The media URLs or objects.
|
|
49
|
+
* @param buttons The optional buttons for the card.
|
|
50
|
+
* @param other Additional properties for the card.
|
|
51
|
+
* @returns The animation card attachment.
|
|
52
|
+
*/
|
|
53
|
+
static animationCard (
|
|
54
|
+
title: string,
|
|
55
|
+
media: (MediaUrl | string)[],
|
|
56
|
+
buttons?: (CardAction | string)[],
|
|
57
|
+
other?: Partial<AnimationCard>
|
|
58
|
+
): Attachment {
|
|
59
|
+
return CardFactory.mediaCard(CardFactory.contentTypes.animationCard, title, media, buttons, other)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Creates an audio card attachment.
|
|
64
|
+
* @param title The title of the card.
|
|
65
|
+
* @param media The media URLs or objects.
|
|
66
|
+
* @param buttons The optional buttons for the card.
|
|
67
|
+
* @param other Additional properties for the card.
|
|
68
|
+
* @returns The audio card attachment.
|
|
69
|
+
*/
|
|
70
|
+
static audioCard (
|
|
71
|
+
title: string,
|
|
72
|
+
media: (MediaUrl | string)[],
|
|
73
|
+
buttons?: (CardAction | string)[],
|
|
74
|
+
other?: Partial<AudioCard>
|
|
75
|
+
): Attachment {
|
|
76
|
+
return CardFactory.mediaCard(CardFactory.contentTypes.audioCard, title, media, buttons, other)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Creates a hero card attachment.
|
|
81
|
+
* @param title The title of the card.
|
|
82
|
+
* @param text The optional text for the card.
|
|
83
|
+
* @param images The optional images for the card.
|
|
84
|
+
* @param buttons The optional buttons for the card.
|
|
85
|
+
* @param other Additional properties for the card.
|
|
86
|
+
* @returns The hero card attachment.
|
|
87
|
+
*/
|
|
88
|
+
static heroCard (title: string, text?: any, images?: any, buttons?: any, other?: Partial<HeroCard>): Attachment {
|
|
89
|
+
const a: Attachment = CardFactory.thumbnailCard(title, text, images, buttons, other)
|
|
90
|
+
a.contentType = CardFactory.contentTypes.heroCard
|
|
91
|
+
return a
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Creates a receipt card attachment.
|
|
96
|
+
* @param card The receipt card content.
|
|
97
|
+
* @returns The receipt card attachment.
|
|
98
|
+
*/
|
|
99
|
+
static receiptCard (card: ReceiptCard): Attachment {
|
|
100
|
+
return { contentType: CardFactory.contentTypes.receiptCard, content: card }
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Creates an O365 connector card attachment.
|
|
105
|
+
* @param card The O365 connector card content.
|
|
106
|
+
* @returns The O365 connector card attachment.
|
|
107
|
+
*/
|
|
108
|
+
static o365ConnectorCard (card: O365ConnectorCard): Attachment {
|
|
109
|
+
return { contentType: CardFactory.contentTypes.o365ConnectorCard, content: card }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Creates a thumbnail card attachment.
|
|
114
|
+
* @param title The title of the card.
|
|
115
|
+
* @param text The optional text for the card.
|
|
116
|
+
* @param images The optional images for the card.
|
|
117
|
+
* @param buttons The optional buttons for the card.
|
|
118
|
+
* @param other Additional properties for the card.
|
|
119
|
+
* @returns The thumbnail card attachment.
|
|
120
|
+
*/
|
|
121
|
+
static thumbnailCard (
|
|
122
|
+
title: string,
|
|
123
|
+
text?: any,
|
|
124
|
+
images?: any,
|
|
125
|
+
buttons?: any,
|
|
126
|
+
other?: Partial<ThumbnailCard>
|
|
127
|
+
): Attachment {
|
|
128
|
+
if (typeof text !== 'string') {
|
|
129
|
+
other = buttons
|
|
130
|
+
buttons = images
|
|
131
|
+
images = text
|
|
132
|
+
text = undefined
|
|
133
|
+
}
|
|
134
|
+
const card: Partial<ThumbnailCard> = { ...other }
|
|
135
|
+
if (title) {
|
|
136
|
+
card.title = title
|
|
137
|
+
}
|
|
138
|
+
if (text) {
|
|
139
|
+
card.text = text
|
|
140
|
+
}
|
|
141
|
+
if (images) {
|
|
142
|
+
card.images = CardFactory.images(images)
|
|
143
|
+
}
|
|
144
|
+
if (buttons) {
|
|
145
|
+
card.buttons = CardFactory.actions(buttons)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return { contentType: CardFactory.contentTypes.thumbnailCard, content: card }
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Creates a video card attachment.
|
|
153
|
+
* @param title The title of the card.
|
|
154
|
+
* @param media The media URLs or objects.
|
|
155
|
+
* @param buttons The optional buttons for the card.
|
|
156
|
+
* @param other Additional properties for the card.
|
|
157
|
+
* @returns The video card attachment.
|
|
158
|
+
*/
|
|
159
|
+
static videoCard (
|
|
160
|
+
title: string,
|
|
161
|
+
media: (MediaUrl | string)[],
|
|
162
|
+
buttons?: (CardAction | string)[],
|
|
163
|
+
other?: Partial<VideoCard>
|
|
164
|
+
): Attachment {
|
|
165
|
+
return CardFactory.mediaCard(CardFactory.contentTypes.videoCard, title, media, buttons, other)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Converts an array of image URLs or objects to an array of CardImage objects.
|
|
170
|
+
* @param images The image URLs or objects.
|
|
171
|
+
* @returns The array of CardImage objects.
|
|
172
|
+
*/
|
|
173
|
+
static images (images: (CardImage | string)[] | undefined): CardImage[] {
|
|
174
|
+
const list: CardImage[] = [];
|
|
175
|
+
(images || []).forEach((img: CardImage | string) => {
|
|
176
|
+
if (typeof img === 'object') {
|
|
177
|
+
list.push(img)
|
|
178
|
+
} else {
|
|
179
|
+
list.push({ url: img })
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
return list
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Converts an array of action URLs or objects to an array of CardAction objects.
|
|
188
|
+
* @param actions The action URLs or objects.
|
|
189
|
+
* @returns The array of CardAction objects.
|
|
190
|
+
*/
|
|
191
|
+
static actions (actions: (CardAction | string)[] | undefined): CardAction[] {
|
|
192
|
+
const list: CardAction[] = [];
|
|
193
|
+
(actions || []).forEach((a: CardAction | string) => {
|
|
194
|
+
if (typeof a === 'object') {
|
|
195
|
+
list.push(a)
|
|
196
|
+
} else {
|
|
197
|
+
list.push({
|
|
198
|
+
type: ActionTypes.ImBack,
|
|
199
|
+
value: a.toString(),
|
|
200
|
+
title: a.toString(),
|
|
201
|
+
channelData: undefined,
|
|
202
|
+
})
|
|
203
|
+
}
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
return list
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Creates an OAuth card attachment.
|
|
211
|
+
* @param connectionName The connection name.
|
|
212
|
+
* @param title The title of the card.
|
|
213
|
+
* @param text The optional text for the card.
|
|
214
|
+
* @param signingResource The signing resource.
|
|
215
|
+
* @returns The OAuth card attachment.
|
|
216
|
+
*/
|
|
217
|
+
static oauthCard (connectionName: string, title: string, text: string, signingResource: SigningResource) : Attachment {
|
|
218
|
+
const card: Partial<OAuthCard> = {
|
|
219
|
+
buttons: [{ type: ActionTypes.Signin, title, value: signingResource.singingLink, channelData: undefined }],
|
|
220
|
+
connectionName,
|
|
221
|
+
tokenExchangeResource: signingResource.tokenExchangeResource,
|
|
222
|
+
tokenPostResource: signingResource.tokenPostResource,
|
|
223
|
+
}
|
|
224
|
+
if (text) {
|
|
225
|
+
card.text = text
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return { contentType: CardFactory.contentTypes.oauthCard, content: card }
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Converts an array of media URLs or objects to an array of MediaUrl objects.
|
|
233
|
+
* @param links The media URLs or objects.
|
|
234
|
+
* @returns The array of MediaUrl objects.
|
|
235
|
+
*/
|
|
236
|
+
static media (links: (MediaUrl | string)[] | undefined): MediaUrl[] {
|
|
237
|
+
const list: MediaUrl[] = [];
|
|
238
|
+
(links || []).forEach((lnk: MediaUrl | string) => {
|
|
239
|
+
if (typeof lnk === 'object') {
|
|
240
|
+
list.push(lnk)
|
|
241
|
+
} else {
|
|
242
|
+
list.push({ url: lnk })
|
|
243
|
+
}
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
return list
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Creates a media card attachment.
|
|
251
|
+
* @param contentType The content type of the card.
|
|
252
|
+
* @param title The title of the card.
|
|
253
|
+
* @param media The media URLs or objects.
|
|
254
|
+
* @param buttons The optional buttons for the card.
|
|
255
|
+
* @param other Additional properties for the card.
|
|
256
|
+
* @returns The media card attachment.
|
|
257
|
+
*/
|
|
258
|
+
private static mediaCard (
|
|
259
|
+
contentType: string,
|
|
260
|
+
title: string,
|
|
261
|
+
media: (MediaUrl | string)[],
|
|
262
|
+
buttons?: (CardAction | string)[],
|
|
263
|
+
other?: any
|
|
264
|
+
): Attachment {
|
|
265
|
+
const card: VideoCard = { ...other }
|
|
266
|
+
if (title) {
|
|
267
|
+
card.title = title
|
|
268
|
+
}
|
|
269
|
+
card.media = CardFactory.media(media)
|
|
270
|
+
if (buttons) {
|
|
271
|
+
card.buttons = CardFactory.actions(buttons)
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return { contentType, content: card }
|
|
275
|
+
}
|
|
276
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright(c) Microsoft Corporation.All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { CardAction } from '@microsoft/agents-activity'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Interface representing a Card Image.
|
|
10
|
+
*/
|
|
11
|
+
export interface CardImage {
|
|
12
|
+
/** The URL of the image. */
|
|
13
|
+
url: string
|
|
14
|
+
/** The alternative text for the image. */
|
|
15
|
+
alt?: string
|
|
16
|
+
/** The action to be performed when the image is tapped. */
|
|
17
|
+
tap?: CardAction
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright(c) Microsoft Corporation.All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Interface representing a Fact.
|
|
8
|
+
*/
|
|
9
|
+
export interface Fact {
|
|
10
|
+
/** The key of the fact. */
|
|
11
|
+
key: string;
|
|
12
|
+
/** The value of the fact. */
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright(c) Microsoft Corporation.All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { CardAction } from '@microsoft/agents-activity'
|
|
7
|
+
import { CardImage } from './cardImage'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Interface representing a Hero Card.
|
|
11
|
+
*/
|
|
12
|
+
export interface HeroCard {
|
|
13
|
+
/** The title of the card. */
|
|
14
|
+
title: string
|
|
15
|
+
/** The subtitle of the card. */
|
|
16
|
+
subtitle: string
|
|
17
|
+
/** The text content of the card. */
|
|
18
|
+
text: string
|
|
19
|
+
/** The images to be displayed on the card. */
|
|
20
|
+
images: CardImage[]
|
|
21
|
+
/** The buttons to be displayed on the card. */
|
|
22
|
+
buttons: CardAction[]
|
|
23
|
+
/** The action to be performed when the card is tapped. */
|
|
24
|
+
tap: CardAction
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './animationCard'
|
|
2
|
+
export * from './audioCard'
|
|
3
|
+
export * from './cardFactory'
|
|
4
|
+
export * from './cardImage'
|
|
5
|
+
export * from './fact'
|
|
6
|
+
export * from './heroCard'
|
|
7
|
+
export * from './mediaUrl'
|
|
8
|
+
export * from './o365ConnectorCard'
|
|
9
|
+
export * from './o365ConnectorCardActionBase'
|
|
10
|
+
export * from './o365ConnectorCardFact'
|
|
11
|
+
export * from './o365ConnectorCardImage'
|
|
12
|
+
export * from './o365ConnectorCardSection'
|
|
13
|
+
export * from './receiptCard'
|
|
14
|
+
export * from './receiptItem'
|
|
15
|
+
export * from './taskModuleAction'
|
|
16
|
+
export * from './thumbnailCard'
|
|
17
|
+
export * from './videoCard'
|
|
@@ -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 media URL.
|
|
8
|
+
*/
|
|
9
|
+
export interface MediaUrl {
|
|
10
|
+
/**
|
|
11
|
+
* The URL of the media.
|
|
12
|
+
*/
|
|
13
|
+
url: string;
|
|
14
|
+
/**
|
|
15
|
+
* The profile of the media.
|
|
16
|
+
*/
|
|
17
|
+
profile?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright(c) Microsoft Corporation.All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { O365ConnectorCardActionBase } from './o365ConnectorCardActionBase'
|
|
7
|
+
import { O365ConnectorCardSection } from './o365ConnectorCardSection'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Represents an O365 connector card.
|
|
11
|
+
*/
|
|
12
|
+
export interface O365ConnectorCard {
|
|
13
|
+
/**
|
|
14
|
+
* The title of the card.
|
|
15
|
+
*/
|
|
16
|
+
title?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The text of the card.
|
|
19
|
+
*/
|
|
20
|
+
text?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The summary of the card.
|
|
23
|
+
*/
|
|
24
|
+
summary?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The theme color of the card.
|
|
27
|
+
*/
|
|
28
|
+
themeColor?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The sections of the card.
|
|
31
|
+
*/
|
|
32
|
+
sections?: O365ConnectorCardSection[];
|
|
33
|
+
/**
|
|
34
|
+
* The potential actions of the card.
|
|
35
|
+
*/
|
|
36
|
+
potentialAction?: O365ConnectorCardActionBase[];
|
|
37
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright(c) Microsoft Corporation.All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type O365ConnectorCardActionType = 'ViewAction' | 'OpenUri' | 'HttpPOST' | 'ActionCard'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents a base action in an O365 connector card.
|
|
10
|
+
*/
|
|
11
|
+
export interface O365ConnectorCardActionBase {
|
|
12
|
+
/**
|
|
13
|
+
* The type of the action.
|
|
14
|
+
*/
|
|
15
|
+
'@type'?: O365ConnectorCardActionType;
|
|
16
|
+
/**
|
|
17
|
+
* The name of the action.
|
|
18
|
+
*/
|
|
19
|
+
name?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The ID of the action.
|
|
22
|
+
*/
|
|
23
|
+
'@id'?: string;
|
|
24
|
+
}
|
|
@@ -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 fact in an O365 connector card.
|
|
8
|
+
*/
|
|
9
|
+
export interface O365ConnectorCardFact {
|
|
10
|
+
/**
|
|
11
|
+
* The name of the fact.
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The value of the fact.
|
|
16
|
+
*/
|
|
17
|
+
value?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright(c) Microsoft Corporation.All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents an image in an O365 connector card.
|
|
8
|
+
*/
|
|
9
|
+
export interface O365ConnectorCardImage {
|
|
10
|
+
/**
|
|
11
|
+
* The URL of the image.
|
|
12
|
+
*/
|
|
13
|
+
image?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The title of the image.
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright(c) Microsoft Corporation.All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { O365ConnectorCardActionBase } from './o365ConnectorCardActionBase'
|
|
7
|
+
import { O365ConnectorCardFact } from './o365ConnectorCardFact'
|
|
8
|
+
import { O365ConnectorCardImage } from './o365ConnectorCardImage'
|
|
9
|
+
|
|
10
|
+
export type ActivityImageType = 'avatar' | 'article'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Represents a section in an O365 connector card.
|
|
14
|
+
*/
|
|
15
|
+
export interface O365ConnectorCardSection {
|
|
16
|
+
/**
|
|
17
|
+
* The title of the section.
|
|
18
|
+
*/
|
|
19
|
+
title?: string
|
|
20
|
+
/**
|
|
21
|
+
* The text of the section.
|
|
22
|
+
*/
|
|
23
|
+
text?: string
|
|
24
|
+
/**
|
|
25
|
+
* The activity title of the section.
|
|
26
|
+
*/
|
|
27
|
+
activityTitle?: string
|
|
28
|
+
/**
|
|
29
|
+
* The activity subtitle of the section.
|
|
30
|
+
*/
|
|
31
|
+
activitySubtitle?: string
|
|
32
|
+
/**
|
|
33
|
+
* The activity text of the section.
|
|
34
|
+
*/
|
|
35
|
+
activityText?: string
|
|
36
|
+
/**
|
|
37
|
+
* The activity image of the section.
|
|
38
|
+
*/
|
|
39
|
+
activityImage?: string
|
|
40
|
+
/**
|
|
41
|
+
* The type of the activity image.
|
|
42
|
+
*/
|
|
43
|
+
activityImageType?: ActivityImageType
|
|
44
|
+
/**
|
|
45
|
+
* Indicates whether markdown is enabled.
|
|
46
|
+
*/
|
|
47
|
+
markdown?: boolean
|
|
48
|
+
/**
|
|
49
|
+
* The facts of the section.
|
|
50
|
+
*/
|
|
51
|
+
facts?: O365ConnectorCardFact[]
|
|
52
|
+
/**
|
|
53
|
+
* The images of the section.
|
|
54
|
+
*/
|
|
55
|
+
images?: O365ConnectorCardImage[]
|
|
56
|
+
/**
|
|
57
|
+
* The potential actions of the section.
|
|
58
|
+
*/
|
|
59
|
+
potentialAction?: O365ConnectorCardActionBase[]
|
|
60
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright(c) Microsoft Corporation.All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { CardAction } from '@microsoft/agents-activity'
|
|
7
|
+
import { Fact } from './fact'
|
|
8
|
+
import { ReceiptItem } from './receiptItem'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents a receipt card.
|
|
12
|
+
*/
|
|
13
|
+
export interface ReceiptCard {
|
|
14
|
+
/**
|
|
15
|
+
* The title of the card.
|
|
16
|
+
*/
|
|
17
|
+
title: string;
|
|
18
|
+
/**
|
|
19
|
+
* The facts of the card.
|
|
20
|
+
*/
|
|
21
|
+
facts: Fact[];
|
|
22
|
+
/**
|
|
23
|
+
* The items of the card.
|
|
24
|
+
*/
|
|
25
|
+
items: ReceiptItem[];
|
|
26
|
+
/**
|
|
27
|
+
* The tap action of the card.
|
|
28
|
+
*/
|
|
29
|
+
tap?: CardAction;
|
|
30
|
+
/**
|
|
31
|
+
* The total amount of the receipt.
|
|
32
|
+
*/
|
|
33
|
+
total: string;
|
|
34
|
+
/**
|
|
35
|
+
* The tax amount of the receipt.
|
|
36
|
+
*/
|
|
37
|
+
tax: string;
|
|
38
|
+
/**
|
|
39
|
+
* The VAT amount of the receipt.
|
|
40
|
+
*/
|
|
41
|
+
vat?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The buttons of the card.
|
|
44
|
+
*/
|
|
45
|
+
buttons: CardAction[];
|
|
46
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright(c) Microsoft Corporation.All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { CardAction } from '@microsoft/agents-activity'
|
|
7
|
+
import { CardImage } from './cardImage'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Represents an item in a receipt card.
|
|
11
|
+
*/
|
|
12
|
+
export interface ReceiptItem {
|
|
13
|
+
/**
|
|
14
|
+
* The title of the item.
|
|
15
|
+
*/
|
|
16
|
+
title: string
|
|
17
|
+
/**
|
|
18
|
+
* The subtitle of the item.
|
|
19
|
+
*/
|
|
20
|
+
subtitle?: string
|
|
21
|
+
/**
|
|
22
|
+
* The text of the item.
|
|
23
|
+
*/
|
|
24
|
+
text?: string
|
|
25
|
+
/**
|
|
26
|
+
* The image of the item.
|
|
27
|
+
*/
|
|
28
|
+
image: CardImage
|
|
29
|
+
/**
|
|
30
|
+
* The price of the item.
|
|
31
|
+
*/
|
|
32
|
+
price: string
|
|
33
|
+
/**
|
|
34
|
+
* The quantity of the item.
|
|
35
|
+
*/
|
|
36
|
+
quantity: number
|
|
37
|
+
/**
|
|
38
|
+
* The tap action of the item.
|
|
39
|
+
*/
|
|
40
|
+
tap?: CardAction
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { CardAction } from '@microsoft/agents-activity'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents a sign-in card.
|
|
8
|
+
*/
|
|
9
|
+
export interface SigninCard {
|
|
10
|
+
/**
|
|
11
|
+
* The text to display on the sign-in card.
|
|
12
|
+
*/
|
|
13
|
+
text?: string
|
|
14
|
+
/**
|
|
15
|
+
* The buttons to include on the sign-in card.
|
|
16
|
+
*/
|
|
17
|
+
buttons: CardAction[]
|
|
18
|
+
}
|