@microsoft/teams-js 2.18.0 → 2.19.0-beta.0

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.
@@ -502,6 +502,399 @@ export namespace conversations {
502
502
  function isSupported(): boolean;
503
503
  }
504
504
 
505
+ /**
506
+ * @hidden
507
+ * Namespace to delegate authentication and message extension requests to the host
508
+ * @internal
509
+ * Limited to Microsoft-internal use
510
+ */
511
+ export namespace externalAppAuthentication {
512
+ /**
513
+ * @hidden
514
+ * Information about the bot request that should be resent by the host
515
+ * @internal
516
+ * Limited to Microsoft-internal use
517
+ */
518
+ type IOriginalRequestInfo = IQueryMessageExtensionRequest | IActionExecuteInvokeRequest;
519
+ /**
520
+ * @hidden
521
+ * Parameters for the authentication pop-up. This interface is used exclusively with the externalAppAuthentication APIs
522
+ * @internal
523
+ * Limited to Microsoft-internal use
524
+ */
525
+ type AuthenticatePopUpParameters = {
526
+ /**
527
+ * The URL for the authentication pop-up.
528
+ */
529
+ url: URL;
530
+ /**
531
+ * The preferred width for the pop-up. This value can be ignored if outside the acceptable bounds.
532
+ */
533
+ width?: number;
534
+ /**
535
+ * The preferred height for the pop-up. This value can be ignored if outside the acceptable bounds.
536
+ */
537
+ height?: number;
538
+ /**
539
+ * Some identity providers restrict their authentication pages from being displayed in embedded browsers (e.g., a web view inside of a native application)
540
+ * If the identity provider you are using prevents embedded browser usage, this flag should be set to `true` to enable the authentication page specified in
541
+ * the {@link url} property to be opened in an external browser.
542
+ * If this flag is `false`, the page will be opened directly within the current hosting application.
543
+ *
544
+ * This flag is ignored when the host for the application is a web app (as opposed to a native application) as the behavior is unnecessary in a web-only
545
+ * environment without an embedded browser.
546
+ */
547
+ isExternal?: boolean;
548
+ };
549
+ /**
550
+ * @hidden
551
+ * Parameters for SSO authentication. This interface is used exclusively with the externalAppAuthentication APIs
552
+ * @internal
553
+ * Limited to Microsoft-internal use
554
+ */
555
+ type AuthTokenRequestParameters = {
556
+ /**
557
+ * An optional list of claims which to pass to Microsoft Entra when requesting the access token.
558
+ */
559
+ claims?: string[];
560
+ /**
561
+ * An optional flag indicating whether to attempt the token acquisition silently or allow a prompt to be shown.
562
+ */
563
+ silent?: boolean;
564
+ };
565
+ /**
566
+ * @hidden
567
+ * Information about the message extension request that should be resent by the host. Corresponds to request schema in https://learn.microsoft.com/en-us/microsoftteams/platform/resources/messaging-extension-v3/search-extensions#receive-user-requests
568
+ * @internal
569
+ * Limited to Microsoft-internal use
570
+ */
571
+ interface IQueryMessageExtensionRequest {
572
+ requestType: OriginalRequestType.QueryMessageExtensionRequest;
573
+ commandId: string;
574
+ parameters: {
575
+ name: string;
576
+ value: string;
577
+ }[];
578
+ queryOptions?: {
579
+ count: number;
580
+ skip: number;
581
+ };
582
+ }
583
+ /**
584
+ * @hidden
585
+ * Information about the Action.Execute request that should be resent by the host. Corresponds to schema in https://adaptivecards.io/explorer/Action.Execute.html
586
+ * @internal
587
+ * Limited to Microsoft-internal use
588
+ */
589
+ interface IActionExecuteInvokeRequest {
590
+ requestType: OriginalRequestType.ActionExecuteInvokeRequest;
591
+ type: string;
592
+ id: string;
593
+ verb: string;
594
+ data: string | Record<string, unknown>;
595
+ }
596
+ /**
597
+ * @hidden
598
+ * Used to differentiate between IOriginalRequestInfo types
599
+ * @internal
600
+ * Limited to Microsoft-internal use
601
+ */
602
+ enum OriginalRequestType {
603
+ ActionExecuteInvokeRequest = "ActionExecuteInvokeRequest",
604
+ QueryMessageExtensionRequest = "QueryMessageExtensionRequest"
605
+ }
606
+ /**
607
+ * @hidden
608
+ * The response from the bot returned via the host
609
+ * @internal
610
+ * Limited to Microsoft-internal use
611
+ */
612
+ type IInvokeResponse = IQueryMessageExtensionResponse | IActionExecuteResponse;
613
+ /**
614
+ * @hidden
615
+ * Used to differentiate between IInvokeResponse types
616
+ * @internal
617
+ * Limited to Microsoft-internal use
618
+ */
619
+ enum InvokeResponseType {
620
+ ActionExecuteInvokeResponse = "ActionExecuteInvokeResponse",
621
+ QueryMessageExtensionResponse = "QueryMessageExtensionResponse"
622
+ }
623
+ /**
624
+ * @hidden
625
+ * The response from the bot returned via the host for a message extension query request.
626
+ * @internal
627
+ * Limited to Microsoft-internal use
628
+ */
629
+ interface IQueryMessageExtensionResponse {
630
+ responseType: InvokeResponseType.QueryMessageExtensionResponse;
631
+ composeExtension: ComposeExtensionResponse;
632
+ }
633
+ /**
634
+ * @hidden
635
+ * The response from the bot returned via the host for an Action.Execute request.
636
+ * @internal
637
+ * Limited to Microsoft-internal use
638
+ */
639
+ interface IActionExecuteResponse {
640
+ responseType: InvokeResponseType.ActionExecuteInvokeResponse;
641
+ value: Record<string, unknown>;
642
+ signature?: string;
643
+ statusCode: number;
644
+ type: string;
645
+ }
646
+ /**
647
+ * @hidden
648
+ * The compose extension response returned for a message extension query request. `suggestedActions` will be present only when the type is is 'config' or 'auth'.
649
+ * @internal
650
+ * Limited to Microsoft-internal use
651
+ */
652
+ type ComposeExtensionResponse = {
653
+ attachmentLayout: AttachmentLayout;
654
+ type: ComposeResultTypes;
655
+ attachments?: QueryMessageExtensionAttachment[];
656
+ suggestedActions?: QueryMessageExtensionSuggestedActions;
657
+ text?: string;
658
+ };
659
+ /**
660
+ * @hidden
661
+ *
662
+ * @internal
663
+ * Limited to Microsoft-internal use
664
+ */
665
+ type QueryMessageExtensionSuggestedActions = {
666
+ actions: Action[];
667
+ };
668
+ /**
669
+ * @hidden
670
+ *
671
+ * @internal
672
+ * Limited to Microsoft-internal use
673
+ */
674
+ type Action = {
675
+ type: string;
676
+ title: string;
677
+ value: string;
678
+ };
679
+ /**
680
+ * @hidden
681
+ *
682
+ * @internal
683
+ * Limited to Microsoft-internal use
684
+ */
685
+ type QueryMessageExtensionCard = {
686
+ contentType: string;
687
+ content: Record<string, unknown>;
688
+ fallbackHtml?: string;
689
+ signature?: string;
690
+ };
691
+ /**
692
+ * @hidden
693
+ *
694
+ * @internal
695
+ * Limited to Microsoft-internal use
696
+ */
697
+ type QueryMessageExtensionAttachment = QueryMessageExtensionCard & {
698
+ preview?: QueryMessageExtensionCard;
699
+ };
700
+ /**
701
+ * @hidden
702
+ *
703
+ * @internal
704
+ * Limited to Microsoft-internal use
705
+ */
706
+ type AttachmentLayout = 'grid' | 'list';
707
+ /**
708
+ * @hidden
709
+ *
710
+ * @internal
711
+ * Limited to Microsoft-internal use
712
+ */
713
+ type ComposeResultTypes = 'auth' | 'config' | 'message' | 'result' | 'silentAuth';
714
+ /*********** BEGIN ERROR TYPE ***********/
715
+ interface InvokeError {
716
+ errorCode: InvokeErrorCode;
717
+ message?: string;
718
+ }
719
+ /**
720
+ * @hidden
721
+ *
722
+ * @internal
723
+ * Limited to Microsoft-internal use
724
+ */
725
+ enum InvokeErrorCode {
726
+ INTERNAL_ERROR = "INTERNAL_ERROR"
727
+ }
728
+ /**
729
+ * @beta
730
+ * @hidden
731
+ * Signals to the host to perform authentication using the given authentication parameters and then resend the request to the application specified by the app ID with the authentication result.
732
+ * @internal
733
+ * Limited to Microsoft-internal use
734
+ * @param appId ID of the application backend to which the request and authentication response should be sent. This must be a UUID
735
+ * @param authenticateParameters Parameters for the authentication pop-up
736
+ * @param originalRequestInfo Information about the original request that should be resent
737
+ * @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
738
+ */
739
+ function authenticateAndResendRequest(appId: string, authenticateParameters: AuthenticatePopUpParameters, originalRequestInfo: IOriginalRequestInfo): Promise<IInvokeResponse>;
740
+ /**
741
+ * @beta
742
+ * @hidden
743
+ * Signals to the host to perform SSO authentication for the application specified by the app ID
744
+ * @internal
745
+ * Limited to Microsoft-internal use
746
+ * @param appId ID of the application backend for which the host should attempt SSO authentication. This must be a UUID
747
+ * @param authTokenRequest Parameters for SSO authentication
748
+ * @returns A promise that resolves when authentication and succeeds and rejects with InvokeError on failure
749
+ */
750
+ function authenticateWithSSO(appId: string, authTokenRequest: AuthTokenRequestParameters): Promise<void>;
751
+ /**
752
+ * @beta
753
+ * @hidden
754
+ * Signals to the host to perform SSO authentication for the application specified by the app ID and then resend the request to the application backend with the authentication result
755
+ * @internal
756
+ * Limited to Microsoft-internal use
757
+ * @param appId ID of the application backend for which the host should attempt SSO authentication and resend the request and authentication response. This must be a UUID.
758
+ * @param authTokenRequest Parameters for SSO authentication
759
+ * @param originalRequestInfo Information about the original request that should be resent
760
+ * @returns A promise that resolves to the IInvokeResponse from the application backend and rejects with InvokeError if the host encounters an error while authenticating or resending the request
761
+ */
762
+ function authenticateWithSSOAndResendRequest(appId: string, authTokenRequest: AuthTokenRequestParameters, originalRequestInfo: IOriginalRequestInfo): Promise<IInvokeResponse>;
763
+ /**
764
+ * @hidden
765
+ * Checks if the externalAppAuthentication capability is supported by the host
766
+ * @returns boolean to represent whether externalAppAuthentication capability is supported
767
+ *
768
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
769
+ *
770
+ * @internal
771
+ * Limited to Microsoft-internal use
772
+ */
773
+ function isSupported(): boolean;
774
+ }
775
+
776
+ /**
777
+ * @hidden
778
+ * Namespace to delegate adaptive card action execution to the host
779
+ * @internal
780
+ * Limited to Microsoft-internal use
781
+ */
782
+ export namespace externalAppCardActions {
783
+ /**
784
+ * @hidden
785
+ * The type of deeplink action that was executed by the host
786
+ * @internal
787
+ * Limited to Microsoft-internal use
788
+ */
789
+ enum ActionOpenUrlType {
790
+ DeepLinkDialog = "DeepLinkDialog",
791
+ DeepLinkOther = "DeepLinkOther",
792
+ DeepLinkStageView = "DeepLinkStageView",
793
+ GenericUrl = "GenericUrl"
794
+ }
795
+ /**
796
+ * @hidden
797
+ * Error that can be thrown from IExternalAppCardActionService.handleActionOpenUrl
798
+ *
799
+ * @internal
800
+ * Limited to Microsoft-internal use
801
+ */
802
+ interface ActionOpenUrlError {
803
+ errorCode: ActionOpenUrlErrorCode;
804
+ message?: string;
805
+ }
806
+ /**
807
+ * @hidden
808
+ * Error codes that can be thrown from IExternalAppCardActionService.handleActionOpenUrl
809
+ * @internal
810
+ * Limited to Microsoft-internal use
811
+ */
812
+ enum ActionOpenUrlErrorCode {
813
+ INTERNAL_ERROR = "INTERNAL_ERROR",
814
+ INVALID_LINK = "INVALID_LINK",
815
+ NOT_SUPPORTED = "NOT_SUPPORTED"
816
+ }
817
+ /**
818
+ * @hidden
819
+ * The payload that is used when executing an Adaptive Card Action.Submit
820
+ * @internal
821
+ * Limited to Microsoft-internal use
822
+ */
823
+ interface IAdaptiveCardActionSubmit {
824
+ id: string;
825
+ data: string | Record<string, unknown>;
826
+ }
827
+ /**
828
+ * @hidden
829
+ * The configuration for Adaptive Card Action.Submit. This indicates which subtypes of actions are supported by the calling app.
830
+ * @internal
831
+ * Limited to Microsoft-internal use
832
+ */
833
+ interface ICardActionsConfig {
834
+ enableImback: boolean;
835
+ enableInvoke: boolean;
836
+ enableDialog: boolean;
837
+ enableStageView: boolean;
838
+ enableSignIn: boolean;
839
+ enableO365Submit: boolean;
840
+ }
841
+ /**
842
+ *
843
+ * @hidden
844
+ * Error that can be thrown from IExternalAppCardActionService.handleActionSubmit
845
+ *
846
+ * @internal
847
+ * Limited to Microsoft-internal use
848
+ */
849
+ interface ActionSubmitError {
850
+ errorCode: ActionSubmitErrorCode;
851
+ message?: string;
852
+ }
853
+ /**
854
+ * @hidden
855
+ * Error codes that can be thrown from IExternalAppCardActionService.handleActionSubmit
856
+ * @internal
857
+ * Limited to Microsoft-internal use
858
+ */
859
+ enum ActionSubmitErrorCode {
860
+ INTERNAL_ERROR = "INTERNAL_ERROR"
861
+ }
862
+ /**
863
+ * @beta
864
+ * @hidden
865
+ * Delegates an Adaptive Card Action.Submit request to the host for the application with the provided app ID
866
+ * @internal
867
+ * Limited to Microsoft-internal use
868
+ * @param appId ID of the application the request is intended for. This must be a UUID
869
+ * @param actionSubmitPayload The Adaptive Card Action.Submit payload
870
+ * @param cardActionsConfig The card actions configuration. This indicates which subtypes should be handled by this API
871
+ * @returns Promise that resolves when the request is completed and rejects with ActionSubmitError if the request fails
872
+ */
873
+ function processActionSubmit(appId: string, actionSubmitPayload: IAdaptiveCardActionSubmit, cardActionsConfig: ICardActionsConfig): Promise<void>;
874
+ /**
875
+ * @beta
876
+ * @hidden
877
+ * Delegates an Adaptive Card Action.OpenUrl request to the host for the application with the provided app ID
878
+ * @internal
879
+ * Limited to Microsoft-internal use
880
+ * @param appId ID of the application the request is intended for. This must be a UUID
881
+ * @param url The URL to open
882
+ * @returns Promise that resolves to ActionOpenUrlType indicating the type of URL that was opened on success and rejects with ActionOpenUrlError if the request fails
883
+ */
884
+ function processActionOpenUrl(appId: string, url: URL): Promise<ActionOpenUrlType>;
885
+ /**
886
+ * @hidden
887
+ * Checks if the externalAppCardActions capability is supported by the host
888
+ * @returns boolean to represent whether externalAppCardActions capability is supported
889
+ *
890
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
891
+ *
892
+ * @internal
893
+ * Limited to Microsoft-internal use
894
+ */
895
+ function isSupported(): boolean;
896
+ }
897
+
505
898
  /**
506
899
  * @hidden
507
900
  *
@@ -1476,6 +1869,13 @@ export namespace meetingRoom {
1476
1869
  export {};
1477
1870
  }
1478
1871
 
1872
+ /**
1873
+ * @hidden
1874
+ * Hidden from Docs
1875
+ *
1876
+ * @internal
1877
+ * Limited to Microsoft-internal use
1878
+ */
1479
1879
  export namespace notifications {
1480
1880
  /**
1481
1881
  * @hidden
@@ -6943,6 +7343,13 @@ export namespace meeting {
6943
7343
  function updateMicState(micState: MicState): void;
6944
7344
  }
6945
7345
 
7346
+ /**
7347
+ * @hidden
7348
+ * Hidden from Docs
7349
+ *
7350
+ * @internal
7351
+ * Limited to Microsoft-internal use
7352
+ */
6946
7353
  export namespace monetization {
6947
7354
  /**
6948
7355
  * @hidden
@@ -7219,6 +7626,9 @@ export namespace teamsCore {
7219
7626
  function isSupported(): boolean;
7220
7627
  }
7221
7628
 
7629
+ /**
7630
+ * Allows your app to add a people picker enabling users to search for and select people in their organization.
7631
+ */
7222
7632
  export namespace people {
7223
7633
  /** Select people callback function type */
7224
7634
  type selectPeopleCallbackFunctionType = (error: SdkError, people: PeoplePickerResult[]) => void;
@@ -8226,6 +8636,130 @@ export namespace appInitialization {
8226
8636
  function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
8227
8637
  }
8228
8638
 
8639
+ /**
8640
+ * Extended files API 3P storage providers, features like sending Blob from Teams to 3P app on user
8641
+ * actions like drag and drop to compose
8642
+ * @beta
8643
+ */
8644
+ export namespace thirdPartyCloudStorage {
8645
+ /**
8646
+ * Object used to represent a file
8647
+ * @beta
8648
+ *
8649
+ */
8650
+ interface FilesFor3PStorage extends Blob {
8651
+ /**
8652
+ * A number that represents the number of milliseconds since the Unix epoch
8653
+ */
8654
+ lastModified: number;
8655
+ /**
8656
+ * Name of the file
8657
+ */
8658
+ name: string;
8659
+ /**
8660
+ * file type
8661
+ */
8662
+ type: string;
8663
+ /**
8664
+ * A string containing the path of the file relative to the ancestor directory the user selected
8665
+ */
8666
+ webkitRelativePath?: string;
8667
+ }
8668
+ /**
8669
+ * File chunks an output of getDragAndDropFiles API from platform
8670
+ * @beta
8671
+ */
8672
+ interface FileChunk {
8673
+ /**
8674
+ * Base 64 data for the requested uri
8675
+ */
8676
+ chunk: string;
8677
+ /**
8678
+ * chunk sequence number
8679
+ */
8680
+ chunkSequence: number;
8681
+ /**
8682
+ * Indicates whether this chunk is the final segment of a file
8683
+ */
8684
+ endOfFile: boolean;
8685
+ }
8686
+ /**
8687
+ * Output of getDragAndDropFiles API from platform
8688
+ * @beta
8689
+ */
8690
+ interface FileResult {
8691
+ /**
8692
+ * Error encountered in getDragAndDropFiles API
8693
+ */
8694
+ error?: SdkError;
8695
+ /**
8696
+ * File chunk which will be assemebled and converted into a blob
8697
+ */
8698
+ fileChunk: FileChunk;
8699
+ /**
8700
+ * File index of the file for which chunk data is getting recieved
8701
+ */
8702
+ fileIndex: number;
8703
+ /**
8704
+ * File type/MIME type which is getting recieved
8705
+ */
8706
+ fileType: string;
8707
+ /**
8708
+ * Indicates whether this file is the last one in a sequence.
8709
+ */
8710
+ isLastFile: boolean;
8711
+ /**
8712
+ * The name of the file.
8713
+ */
8714
+ fileName: string;
8715
+ }
8716
+ /**
8717
+ * Interface to assemble file chunks
8718
+ * @beta
8719
+ */
8720
+ interface AssembleAttachment {
8721
+ /** A number representing the sequence of the attachment in the file chunks. */
8722
+ sequence: number;
8723
+ /** A Blob object representing the data of the file chunks. */
8724
+ file: Blob;
8725
+ }
8726
+ /**
8727
+ * Interface to assemble files
8728
+ * @beta
8729
+ */
8730
+ interface AttachmentListHelper {
8731
+ /** A string representing the MIME type of the file */
8732
+ fileType: string;
8733
+ /** An array of {@link AssembleAttachment | AssembleAttachment} objects representing files to be sent as attachment */
8734
+ assembleAttachment: AssembleAttachment[];
8735
+ }
8736
+ /**
8737
+ * Defines the callback function received from Third Party App
8738
+ * @beta
8739
+ */
8740
+ interface DragAndDropFileCallback {
8741
+ /** Callback from third party app */
8742
+ (files: FilesFor3PStorage[], error?: SdkError): void;
8743
+ }
8744
+ /**
8745
+ * Get drag-and-drop files using a callback.
8746
+ *
8747
+ * @param {string} dragAndDropInput - Teams thread id or Teams conversation id from a Teams chat/channel
8748
+ * @param {DragAndDropFileCallback} dragAndDropFileCallback - callback
8749
+ * A callback function to handle the result of the operation
8750
+ * @beta
8751
+ */
8752
+ function getDragAndDropFiles(dragAndDropInput: string, dragAndDropFileCallback: DragAndDropFileCallback): void;
8753
+ /**
8754
+ * Checks if the thirdPartyCloudStorage capability is supported by the host
8755
+ * @returns boolean to represent whether the thirdPartyCloudStorage capability is supported
8756
+ *
8757
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
8758
+ * @beta
8759
+ */
8760
+ function isSupported(): boolean;
8761
+ }
8762
+
8229
8763
  /** Execute deep link on complete function type */
8230
8764
  export type executeDeepLinkOnCompleteFunctionType = (status: boolean, reason?: string) => void;
8231
8765
  /** Callback function type */