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

Sign up to get free protection for your applications and to get access to all the features.
@@ -156,6 +156,14 @@ export interface FilePreviewParameters {
156
156
  * Limited to Microsoft-internal use
157
157
  */
158
158
  type: string;
159
+ /**
160
+ * @hidden
161
+ * The size of the file in bytes.
162
+ *
163
+ * @internal
164
+ * Limited to Microsoft-internal use
165
+ */
166
+ sizeInBytes?: number;
159
167
  /**
160
168
  * @hidden
161
169
  * A url to the source of the file, used to open the content in the user's default browser
@@ -502,6 +510,385 @@ export namespace conversations {
502
510
  function isSupported(): boolean;
503
511
  }
504
512
 
513
+ /**
514
+ * @hidden
515
+ * Namespace to delegate authentication and message extension requests to the host
516
+ * @internal
517
+ * Limited to Microsoft-internal use
518
+ */
519
+ export namespace externalAppAuthentication {
520
+ /**
521
+ * @hidden
522
+ * Information about the bot request that should be resent by the host
523
+ * @internal
524
+ * Limited to Microsoft-internal use
525
+ */
526
+ type IOriginalRequestInfo = IQueryMessageExtensionRequest | IActionExecuteInvokeRequest;
527
+ /**
528
+ * @hidden
529
+ * Parameters for the authentication pop-up. This interface is used exclusively with the externalAppAuthentication APIs
530
+ * @internal
531
+ * Limited to Microsoft-internal use
532
+ */
533
+ type AuthenticatePopUpParameters = {
534
+ /**
535
+ * The URL for the authentication pop-up.
536
+ */
537
+ url: URL;
538
+ /**
539
+ * The preferred width for the pop-up. This value can be ignored if outside the acceptable bounds.
540
+ */
541
+ width?: number;
542
+ /**
543
+ * The preferred height for the pop-up. This value can be ignored if outside the acceptable bounds.
544
+ */
545
+ height?: number;
546
+ /**
547
+ * Some identity providers restrict their authentication pages from being displayed in embedded browsers (e.g., a web view inside of a native application)
548
+ * 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
549
+ * the {@link url} property to be opened in an external browser.
550
+ * If this flag is `false`, the page will be opened directly within the current hosting application.
551
+ *
552
+ * 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
553
+ * environment without an embedded browser.
554
+ */
555
+ isExternal?: boolean;
556
+ };
557
+ /**
558
+ * @hidden
559
+ * Parameters for SSO authentication. This interface is used exclusively with the externalAppAuthentication APIs
560
+ * @internal
561
+ * Limited to Microsoft-internal use
562
+ */
563
+ type AuthTokenRequestParameters = {
564
+ /**
565
+ * An optional list of claims which to pass to Microsoft Entra when requesting the access token.
566
+ */
567
+ claims?: string[];
568
+ /**
569
+ * An optional flag indicating whether to attempt the token acquisition silently or allow a prompt to be shown.
570
+ */
571
+ silent?: boolean;
572
+ };
573
+ /**
574
+ * @hidden
575
+ * 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
576
+ * @internal
577
+ * Limited to Microsoft-internal use
578
+ */
579
+ interface IQueryMessageExtensionRequest {
580
+ requestType: OriginalRequestType.QueryMessageExtensionRequest;
581
+ commandId: string;
582
+ parameters: {
583
+ name: string;
584
+ value: string;
585
+ }[];
586
+ queryOptions?: {
587
+ count: number;
588
+ skip: number;
589
+ };
590
+ }
591
+ /**
592
+ * @hidden
593
+ * Information about the Action.Execute request that should be resent by the host. Corresponds to schema in https://adaptivecards.io/explorer/Action.Execute.html
594
+ * @internal
595
+ * Limited to Microsoft-internal use
596
+ */
597
+ interface IActionExecuteInvokeRequest {
598
+ requestType: OriginalRequestType.ActionExecuteInvokeRequest;
599
+ type: string;
600
+ id: string;
601
+ verb: string;
602
+ data: string | Record<string, unknown>;
603
+ }
604
+ /**
605
+ * @hidden
606
+ * Used to differentiate between IOriginalRequestInfo types
607
+ * @internal
608
+ * Limited to Microsoft-internal use
609
+ */
610
+ enum OriginalRequestType {
611
+ ActionExecuteInvokeRequest = "ActionExecuteInvokeRequest",
612
+ QueryMessageExtensionRequest = "QueryMessageExtensionRequest"
613
+ }
614
+ /**
615
+ * @hidden
616
+ * The response from the bot returned via the host
617
+ * @internal
618
+ * Limited to Microsoft-internal use
619
+ */
620
+ type IInvokeResponse = IQueryMessageExtensionResponse | IActionExecuteResponse;
621
+ /**
622
+ * @hidden
623
+ * Used to differentiate between IInvokeResponse types
624
+ * @internal
625
+ * Limited to Microsoft-internal use
626
+ */
627
+ enum InvokeResponseType {
628
+ ActionExecuteInvokeResponse = "ActionExecuteInvokeResponse",
629
+ QueryMessageExtensionResponse = "QueryMessageExtensionResponse"
630
+ }
631
+ /**
632
+ * @hidden
633
+ * The response from the bot returned via the host for a message extension query request.
634
+ * @internal
635
+ * Limited to Microsoft-internal use
636
+ */
637
+ interface IQueryMessageExtensionResponse {
638
+ responseType: InvokeResponseType.QueryMessageExtensionResponse;
639
+ composeExtension?: ComposeExtensionResponse;
640
+ }
641
+ /**
642
+ * @hidden
643
+ * The response from the bot returned via the host for an Action.Execute request.
644
+ * @internal
645
+ * Limited to Microsoft-internal use
646
+ */
647
+ interface IActionExecuteResponse {
648
+ responseType: InvokeResponseType.ActionExecuteInvokeResponse;
649
+ value: Record<string, unknown>;
650
+ signature?: string;
651
+ statusCode: number;
652
+ type: string;
653
+ }
654
+ /**
655
+ * @hidden
656
+ * The compose extension response returned for a message extension query request. `suggestedActions` will be present only when the type is is 'config' or 'auth'.
657
+ * @internal
658
+ * Limited to Microsoft-internal use
659
+ */
660
+ type ComposeExtensionResponse = {
661
+ attachmentLayout: AttachmentLayout;
662
+ type: ComposeResultTypes;
663
+ attachments?: QueryMessageExtensionAttachment[];
664
+ suggestedActions?: QueryMessageExtensionSuggestedActions;
665
+ text?: string;
666
+ };
667
+ /**
668
+ * @hidden
669
+ *
670
+ * @internal
671
+ * Limited to Microsoft-internal use
672
+ */
673
+ type QueryMessageExtensionSuggestedActions = {
674
+ actions: Action[];
675
+ };
676
+ /**
677
+ * @hidden
678
+ *
679
+ * @internal
680
+ * Limited to Microsoft-internal use
681
+ */
682
+ type Action = {
683
+ type: string;
684
+ title: string;
685
+ value: string;
686
+ };
687
+ /**
688
+ * @hidden
689
+ *
690
+ * @internal
691
+ * Limited to Microsoft-internal use
692
+ */
693
+ type QueryMessageExtensionCard = {
694
+ contentType: string;
695
+ content: Record<string, unknown>;
696
+ fallbackHtml?: string;
697
+ signature?: string;
698
+ };
699
+ /**
700
+ * @hidden
701
+ *
702
+ * @internal
703
+ * Limited to Microsoft-internal use
704
+ */
705
+ type QueryMessageExtensionAttachment = QueryMessageExtensionCard & {
706
+ preview?: QueryMessageExtensionCard;
707
+ };
708
+ /**
709
+ * @hidden
710
+ *
711
+ * @internal
712
+ * Limited to Microsoft-internal use
713
+ */
714
+ type AttachmentLayout = 'grid' | 'list';
715
+ /**
716
+ * @hidden
717
+ *
718
+ * @internal
719
+ * Limited to Microsoft-internal use
720
+ */
721
+ type ComposeResultTypes = 'auth' | 'config' | 'message' | 'result' | 'silentAuth';
722
+ /*********** BEGIN ERROR TYPE ***********/
723
+ interface InvokeError {
724
+ errorCode: InvokeErrorCode;
725
+ message?: string;
726
+ }
727
+ /**
728
+ * @hidden
729
+ *
730
+ * @internal
731
+ * Limited to Microsoft-internal use
732
+ */
733
+ enum InvokeErrorCode {
734
+ INTERNAL_ERROR = "INTERNAL_ERROR"
735
+ }
736
+ /**
737
+ * @beta
738
+ * @hidden
739
+ * 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.
740
+ * @internal
741
+ * Limited to Microsoft-internal use
742
+ * @param appId ID of the application backend to which the request and authentication response should be sent. This must be a UUID
743
+ * @param authenticateParameters Parameters for the authentication pop-up
744
+ * @param originalRequestInfo Information about the original request that should be resent
745
+ * @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
746
+ */
747
+ function authenticateAndResendRequest(appId: string, authenticateParameters: AuthenticatePopUpParameters, originalRequestInfo: IOriginalRequestInfo): Promise<IInvokeResponse>;
748
+ /**
749
+ * @beta
750
+ * @hidden
751
+ * Signals to the host to perform SSO authentication for the application specified by the app ID
752
+ * @internal
753
+ * Limited to Microsoft-internal use
754
+ * @param appId ID of the application backend for which the host should attempt SSO authentication. This must be a UUID
755
+ * @param authTokenRequest Parameters for SSO authentication
756
+ * @returns A promise that resolves when authentication and succeeds and rejects with InvokeError on failure
757
+ */
758
+ function authenticateWithSSO(appId: string, authTokenRequest: AuthTokenRequestParameters): Promise<void>;
759
+ /**
760
+ * @beta
761
+ * @hidden
762
+ * 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
763
+ * @internal
764
+ * Limited to Microsoft-internal use
765
+ * @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.
766
+ * @param authTokenRequest Parameters for SSO authentication
767
+ * @param originalRequestInfo Information about the original request that should be resent
768
+ * @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
769
+ */
770
+ function authenticateWithSSOAndResendRequest(appId: string, authTokenRequest: AuthTokenRequestParameters, originalRequestInfo: IOriginalRequestInfo): Promise<IInvokeResponse>;
771
+ /**
772
+ * @hidden
773
+ * Checks if the externalAppAuthentication capability is supported by the host
774
+ * @returns boolean to represent whether externalAppAuthentication capability is supported
775
+ *
776
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
777
+ *
778
+ * @internal
779
+ * Limited to Microsoft-internal use
780
+ */
781
+ function isSupported(): boolean;
782
+ }
783
+
784
+ /**
785
+ * @hidden
786
+ * Namespace to delegate adaptive card action execution to the host
787
+ * @internal
788
+ * Limited to Microsoft-internal use
789
+ */
790
+ export namespace externalAppCardActions {
791
+ /**
792
+ * @hidden
793
+ * The type of deeplink action that was executed by the host
794
+ * @internal
795
+ * Limited to Microsoft-internal use
796
+ */
797
+ enum ActionOpenUrlType {
798
+ DeepLinkDialog = "DeepLinkDialog",
799
+ DeepLinkOther = "DeepLinkOther",
800
+ DeepLinkStageView = "DeepLinkStageView",
801
+ GenericUrl = "GenericUrl"
802
+ }
803
+ /**
804
+ * @hidden
805
+ * Error that can be thrown from IExternalAppCardActionService.handleActionOpenUrl
806
+ *
807
+ * @internal
808
+ * Limited to Microsoft-internal use
809
+ */
810
+ interface ActionOpenUrlError {
811
+ errorCode: ActionOpenUrlErrorCode;
812
+ message?: string;
813
+ }
814
+ /**
815
+ * @hidden
816
+ * Error codes that can be thrown from IExternalAppCardActionService.handleActionOpenUrl
817
+ * @internal
818
+ * Limited to Microsoft-internal use
819
+ */
820
+ enum ActionOpenUrlErrorCode {
821
+ INTERNAL_ERROR = "INTERNAL_ERROR",
822
+ INVALID_LINK = "INVALID_LINK",
823
+ NOT_SUPPORTED = "NOT_SUPPORTED"
824
+ }
825
+ /**
826
+ * @hidden
827
+ * The payload that is used when executing an Adaptive Card Action.Submit
828
+ * @internal
829
+ * Limited to Microsoft-internal use
830
+ */
831
+ interface IAdaptiveCardActionSubmit {
832
+ id: string;
833
+ data: string | Record<string, unknown>;
834
+ }
835
+ /**
836
+ *
837
+ * @hidden
838
+ * Error that can be thrown from IExternalAppCardActionService.handleActionSubmit
839
+ *
840
+ * @internal
841
+ * Limited to Microsoft-internal use
842
+ */
843
+ interface ActionSubmitError {
844
+ errorCode: ActionSubmitErrorCode;
845
+ message?: string;
846
+ }
847
+ /**
848
+ * @hidden
849
+ * Error codes that can be thrown from IExternalAppCardActionService.handleActionSubmit
850
+ * @internal
851
+ * Limited to Microsoft-internal use
852
+ */
853
+ enum ActionSubmitErrorCode {
854
+ INTERNAL_ERROR = "INTERNAL_ERROR"
855
+ }
856
+ /**
857
+ * @beta
858
+ * @hidden
859
+ * Delegates an Adaptive Card Action.Submit request to the host for the application with the provided app ID
860
+ * @internal
861
+ * Limited to Microsoft-internal use
862
+ * @param appId ID of the application the request is intended for. This must be a UUID
863
+ * @param actionSubmitPayload The Adaptive Card Action.Submit payload
864
+ * @param cardActionsConfig The card actions configuration. This indicates which subtypes should be handled by this API
865
+ * @returns Promise that resolves when the request is completed and rejects with ActionSubmitError if the request fails
866
+ */
867
+ function processActionSubmit(appId: string, actionSubmitPayload: IAdaptiveCardActionSubmit): Promise<void>;
868
+ /**
869
+ * @beta
870
+ * @hidden
871
+ * Delegates an Adaptive Card Action.OpenUrl request to the host for the application with the provided app ID
872
+ * @internal
873
+ * Limited to Microsoft-internal use
874
+ * @param appId ID of the application the request is intended for. This must be a UUID
875
+ * @param url The URL to open
876
+ * @returns Promise that resolves to ActionOpenUrlType indicating the type of URL that was opened on success and rejects with ActionOpenUrlError if the request fails
877
+ */
878
+ function processActionOpenUrl(appId: string, url: URL): Promise<ActionOpenUrlType>;
879
+ /**
880
+ * @hidden
881
+ * Checks if the externalAppCardActions capability is supported by the host
882
+ * @returns boolean to represent whether externalAppCardActions capability is supported
883
+ *
884
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
885
+ *
886
+ * @internal
887
+ * Limited to Microsoft-internal use
888
+ */
889
+ function isSupported(): boolean;
890
+ }
891
+
505
892
  /**
506
893
  * @hidden
507
894
  *
@@ -1476,6 +1863,13 @@ export namespace meetingRoom {
1476
1863
  export {};
1477
1864
  }
1478
1865
 
1866
+ /**
1867
+ * @hidden
1868
+ * Hidden from Docs
1869
+ *
1870
+ * @internal
1871
+ * Limited to Microsoft-internal use
1872
+ */
1479
1873
  export namespace notifications {
1480
1874
  /**
1481
1875
  * @hidden
@@ -6343,6 +6737,14 @@ export namespace meeting {
6343
6737
  message?: string;
6344
6738
  };
6345
6739
  }
6740
+ /** Defines additional sharing options which can be provided to the {@link shareAppContentToStage} API. */
6741
+ interface IShareAppContentToStageOptions {
6742
+ /**
6743
+ * The protocol option for sharing app content to the meeting stage. Defaults to `Collaborative`.
6744
+ * See {@link SharingProtocol} for more information.
6745
+ */
6746
+ sharingProtocol?: SharingProtocol;
6747
+ }
6346
6748
  /** Represents app permission to share contents to meeting. */
6347
6749
  interface IAppContentStageSharingCapabilities {
6348
6750
  /**
@@ -6629,6 +7031,20 @@ export namespace meeting {
6629
7031
  */
6630
7032
  GroupCall = "groupCall"
6631
7033
  }
7034
+ /**
7035
+ * Represents the protocol option for sharing app content to the meeting stage.
7036
+ */
7037
+ enum SharingProtocol {
7038
+ /**
7039
+ * The default protocol for sharing app content to stage. To learn more, visit https://aka.ms/teamsjs/shareAppContentToStage
7040
+ */
7041
+ Collaborative = "Collaborative",
7042
+ /**
7043
+ * A read-only protocol for sharing app content to stage, which uses screen sharing in meetings. If provided, this protocol will open
7044
+ * the specified `contentUrl` passed to the {@link shareAppContentToStage} API in a new instance and screen share that instance.
7045
+ */
7046
+ ScreenShare = "ScreenShare"
7047
+ }
6632
7048
  /**
6633
7049
  * Allows an app to get the incoming audio speaker setting for the meeting user.
6634
7050
  * To learn more, visit https://aka.ms/teamsjs/getIncomingClientAudioState
@@ -6756,8 +7172,10 @@ export namespace meeting {
6756
7172
  * `result` can either contain a true value, in case of a successful share or null when the share fails
6757
7173
  * @param appContentUrl - is the input URL to be shared to the meeting stage.
6758
7174
  * the URL origin must be included in your app manifest's `validDomains` field.
7175
+ * @param shareOptions - is an object that contains additional sharing options. If omitted, the default
7176
+ * sharing protocol will be `Collaborative`. See {@link IShareAppContentToStageOptions} for more information.
6759
7177
  */
6760
- function shareAppContentToStage(callback: errorCallbackFunctionType, appContentUrl: string): void;
7178
+ function shareAppContentToStage(callback: errorCallbackFunctionType, appContentUrl: string, shareOptions?: IShareAppContentToStageOptions): void;
6761
7179
  /**
6762
7180
  * Allows an app to request whether the local user's app version has the required app manifest permissions to share content to meeting stage.
6763
7181
  * To learn more, visit https://aka.ms/teamsjs/getAppContentStageSharingCapabilities
@@ -6943,6 +7361,13 @@ export namespace meeting {
6943
7361
  function updateMicState(micState: MicState): void;
6944
7362
  }
6945
7363
 
7364
+ /**
7365
+ * @hidden
7366
+ * Hidden from Docs
7367
+ *
7368
+ * @internal
7369
+ * Limited to Microsoft-internal use
7370
+ */
6946
7371
  export namespace monetization {
6947
7372
  /**
6948
7373
  * @hidden
@@ -7219,6 +7644,9 @@ export namespace teamsCore {
7219
7644
  function isSupported(): boolean;
7220
7645
  }
7221
7646
 
7647
+ /**
7648
+ * Allows your app to add a people picker enabling users to search for and select people in their organization.
7649
+ */
7222
7650
  export namespace people {
7223
7651
  /** Select people callback function type */
7224
7652
  type selectPeopleCallbackFunctionType = (error: SdkError, people: PeoplePickerResult[]) => void;
@@ -8226,6 +8654,130 @@ export namespace appInitialization {
8226
8654
  function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
8227
8655
  }
8228
8656
 
8657
+ /**
8658
+ * Extended files API 3P storage providers, features like sending Blob from Teams to 3P app on user
8659
+ * actions like drag and drop to compose
8660
+ * @beta
8661
+ */
8662
+ export namespace thirdPartyCloudStorage {
8663
+ /**
8664
+ * Object used to represent a file
8665
+ * @beta
8666
+ *
8667
+ */
8668
+ interface FilesFor3PStorage extends Blob {
8669
+ /**
8670
+ * A number that represents the number of milliseconds since the Unix epoch
8671
+ */
8672
+ lastModified: number;
8673
+ /**
8674
+ * Name of the file
8675
+ */
8676
+ name: string;
8677
+ /**
8678
+ * file type
8679
+ */
8680
+ type: string;
8681
+ /**
8682
+ * A string containing the path of the file relative to the ancestor directory the user selected
8683
+ */
8684
+ webkitRelativePath?: string;
8685
+ }
8686
+ /**
8687
+ * File chunks an output of getDragAndDropFiles API from platform
8688
+ * @beta
8689
+ */
8690
+ interface FileChunk {
8691
+ /**
8692
+ * Base 64 data for the requested uri
8693
+ */
8694
+ chunk: string;
8695
+ /**
8696
+ * chunk sequence number
8697
+ */
8698
+ chunkSequence: number;
8699
+ /**
8700
+ * Indicates whether this chunk is the final segment of a file
8701
+ */
8702
+ endOfFile: boolean;
8703
+ }
8704
+ /**
8705
+ * Output of getDragAndDropFiles API from platform
8706
+ * @beta
8707
+ */
8708
+ interface FileResult {
8709
+ /**
8710
+ * Error encountered in getDragAndDropFiles API
8711
+ */
8712
+ error?: SdkError;
8713
+ /**
8714
+ * File chunk which will be assemebled and converted into a blob
8715
+ */
8716
+ fileChunk: FileChunk;
8717
+ /**
8718
+ * File index of the file for which chunk data is getting recieved
8719
+ */
8720
+ fileIndex: number;
8721
+ /**
8722
+ * File type/MIME type which is getting recieved
8723
+ */
8724
+ fileType: string;
8725
+ /**
8726
+ * Indicates whether this file is the last one in a sequence.
8727
+ */
8728
+ isLastFile: boolean;
8729
+ /**
8730
+ * The name of the file.
8731
+ */
8732
+ fileName: string;
8733
+ }
8734
+ /**
8735
+ * Interface to assemble file chunks
8736
+ * @beta
8737
+ */
8738
+ interface AssembleAttachment {
8739
+ /** A number representing the sequence of the attachment in the file chunks. */
8740
+ sequence: number;
8741
+ /** A Blob object representing the data of the file chunks. */
8742
+ file: Blob;
8743
+ }
8744
+ /**
8745
+ * Interface to assemble files
8746
+ * @beta
8747
+ */
8748
+ interface AttachmentListHelper {
8749
+ /** A string representing the MIME type of the file */
8750
+ fileType: string;
8751
+ /** An array of {@link AssembleAttachment | AssembleAttachment} objects representing files to be sent as attachment */
8752
+ assembleAttachment: AssembleAttachment[];
8753
+ }
8754
+ /**
8755
+ * Defines the callback function received from Third Party App
8756
+ * @beta
8757
+ */
8758
+ interface DragAndDropFileCallback {
8759
+ /** Callback from third party app */
8760
+ (files: FilesFor3PStorage[], error?: SdkError): void;
8761
+ }
8762
+ /**
8763
+ * Get drag-and-drop files using a callback.
8764
+ *
8765
+ * @param {string} dragAndDropInput - Teams thread id or Teams conversation id from a Teams chat/channel
8766
+ * @param {DragAndDropFileCallback} dragAndDropFileCallback - callback
8767
+ * A callback function to handle the result of the operation
8768
+ * @beta
8769
+ */
8770
+ function getDragAndDropFiles(dragAndDropInput: string, dragAndDropFileCallback: DragAndDropFileCallback): void;
8771
+ /**
8772
+ * Checks if the thirdPartyCloudStorage capability is supported by the host
8773
+ * @returns boolean to represent whether the thirdPartyCloudStorage capability is supported
8774
+ *
8775
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
8776
+ * @beta
8777
+ */
8778
+ function isSupported(): boolean;
8779
+ }
8780
+
8229
8781
  /** Execute deep link on complete function type */
8230
8782
  export type executeDeepLinkOnCompleteFunctionType = (status: boolean, reason?: string) => void;
8231
8783
  /** Callback function type */