@microsoft/teams-js 2.18.0-beta.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.
- package/README.md +4 -4
- package/dist/MicrosoftTeams.d.ts +206 -19
- package/dist/MicrosoftTeams.js +172 -11
- package/dist/MicrosoftTeams.js.map +1 -1
- package/dist/MicrosoftTeams.min.js +1 -1
- package/dist/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
24
24
|
|
25
25
|
### Production
|
26
26
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.18.0/js/MicrosoftTeams.min.js) or point your package manager at them.
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
|
|
45
45
|
```html
|
46
46
|
<!-- Microsoft Teams JavaScript API (via CDN) -->
|
47
47
|
<script
|
48
|
-
src="https://res.cdn.office.net/teams-js/2.
|
49
|
-
integrity="sha384-
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.18.0/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-g8DoRkiR0ECQ9rwKIgY8GjQ5h0d2jp1347CmU/IRlyUHPjJZiFWEOYc+hFtT9MGL"
|
50
50
|
crossorigin="anonymous"
|
51
51
|
></script>
|
52
52
|
|
53
53
|
<!-- Microsoft Teams JavaScript API (via npm) -->
|
54
|
-
<script src="node_modules/@microsoft/teams-js@2.
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.18.0/dist/MicrosoftTeams.min.js"></script>
|
55
55
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
package/dist/MicrosoftTeams.d.ts
CHANGED
@@ -516,6 +516,52 @@ export namespace externalAppAuthentication {
|
|
516
516
|
* Limited to Microsoft-internal use
|
517
517
|
*/
|
518
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
|
+
};
|
519
565
|
/**
|
520
566
|
* @hidden
|
521
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
|
@@ -525,9 +571,9 @@ export namespace externalAppAuthentication {
|
|
525
571
|
interface IQueryMessageExtensionRequest {
|
526
572
|
requestType: OriginalRequestType.QueryMessageExtensionRequest;
|
527
573
|
commandId: string;
|
528
|
-
parameters
|
529
|
-
name
|
530
|
-
value
|
574
|
+
parameters: {
|
575
|
+
name: string;
|
576
|
+
value: string;
|
531
577
|
}[];
|
532
578
|
queryOptions?: {
|
533
579
|
count: number;
|
@@ -582,7 +628,7 @@ export namespace externalAppAuthentication {
|
|
582
628
|
*/
|
583
629
|
interface IQueryMessageExtensionResponse {
|
584
630
|
responseType: InvokeResponseType.QueryMessageExtensionResponse;
|
585
|
-
composeExtension
|
631
|
+
composeExtension: ComposeExtensionResponse;
|
586
632
|
}
|
587
633
|
/**
|
588
634
|
* @hidden
|
@@ -599,14 +645,14 @@ export namespace externalAppAuthentication {
|
|
599
645
|
}
|
600
646
|
/**
|
601
647
|
* @hidden
|
602
|
-
*
|
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'.
|
603
649
|
* @internal
|
604
650
|
* Limited to Microsoft-internal use
|
605
651
|
*/
|
606
652
|
type ComposeExtensionResponse = {
|
607
653
|
attachmentLayout: AttachmentLayout;
|
608
654
|
type: ComposeResultTypes;
|
609
|
-
attachments
|
655
|
+
attachments?: QueryMessageExtensionAttachment[];
|
610
656
|
suggestedActions?: QueryMessageExtensionSuggestedActions;
|
611
657
|
text?: string;
|
612
658
|
};
|
@@ -617,7 +663,7 @@ export namespace externalAppAuthentication {
|
|
617
663
|
* Limited to Microsoft-internal use
|
618
664
|
*/
|
619
665
|
type QueryMessageExtensionSuggestedActions = {
|
620
|
-
actions
|
666
|
+
actions: Action[];
|
621
667
|
};
|
622
668
|
/**
|
623
669
|
* @hidden
|
@@ -685,35 +731,35 @@ export namespace externalAppAuthentication {
|
|
685
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.
|
686
732
|
* @internal
|
687
733
|
* Limited to Microsoft-internal use
|
688
|
-
* @param appId ID of the application backend to which the request and authentication response should be sent
|
734
|
+
* @param appId ID of the application backend to which the request and authentication response should be sent. This must be a UUID
|
689
735
|
* @param authenticateParameters Parameters for the authentication pop-up
|
690
736
|
* @param originalRequestInfo Information about the original request that should be resent
|
691
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
|
692
738
|
*/
|
693
|
-
function authenticateAndResendRequest(appId: string, authenticateParameters:
|
739
|
+
function authenticateAndResendRequest(appId: string, authenticateParameters: AuthenticatePopUpParameters, originalRequestInfo: IOriginalRequestInfo): Promise<IInvokeResponse>;
|
694
740
|
/**
|
695
741
|
* @beta
|
696
742
|
* @hidden
|
697
743
|
* Signals to the host to perform SSO authentication for the application specified by the app ID
|
698
744
|
* @internal
|
699
745
|
* Limited to Microsoft-internal use
|
700
|
-
* @param appId ID of the application backend for which the host should attempt SSO authentication
|
746
|
+
* @param appId ID of the application backend for which the host should attempt SSO authentication. This must be a UUID
|
701
747
|
* @param authTokenRequest Parameters for SSO authentication
|
702
748
|
* @returns A promise that resolves when authentication and succeeds and rejects with InvokeError on failure
|
703
749
|
*/
|
704
|
-
function authenticateWithSSO(appId: string, authTokenRequest:
|
750
|
+
function authenticateWithSSO(appId: string, authTokenRequest: AuthTokenRequestParameters): Promise<void>;
|
705
751
|
/**
|
706
752
|
* @beta
|
707
753
|
* @hidden
|
708
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
|
709
755
|
* @internal
|
710
756
|
* Limited to Microsoft-internal use
|
711
|
-
* @param appId ID of the application backend for which the host should attempt SSO authentication and resend the request and authentication response
|
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.
|
712
758
|
* @param authTokenRequest Parameters for SSO authentication
|
713
759
|
* @param originalRequestInfo Information about the original request that should be resent
|
714
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
|
715
761
|
*/
|
716
|
-
function authenticateWithSSOAndResendRequest(appId: string, authTokenRequest:
|
762
|
+
function authenticateWithSSOAndResendRequest(appId: string, authTokenRequest: AuthTokenRequestParameters, originalRequestInfo: IOriginalRequestInfo): Promise<IInvokeResponse>;
|
717
763
|
/**
|
718
764
|
* @hidden
|
719
765
|
* Checks if the externalAppAuthentication capability is supported by the host
|
@@ -764,9 +810,9 @@ export namespace externalAppCardActions {
|
|
764
810
|
* Limited to Microsoft-internal use
|
765
811
|
*/
|
766
812
|
enum ActionOpenUrlErrorCode {
|
813
|
+
INTERNAL_ERROR = "INTERNAL_ERROR",
|
767
814
|
INVALID_LINK = "INVALID_LINK",
|
768
|
-
NOT_SUPPORTED = "NOT_SUPPORTED"
|
769
|
-
INTERNAL_ERROR = "INTERNAL_ERROR"
|
815
|
+
NOT_SUPPORTED = "NOT_SUPPORTED"
|
770
816
|
}
|
771
817
|
/**
|
772
818
|
* @hidden
|
@@ -776,7 +822,7 @@ export namespace externalAppCardActions {
|
|
776
822
|
*/
|
777
823
|
interface IAdaptiveCardActionSubmit {
|
778
824
|
id: string;
|
779
|
-
data: Record<string, unknown>;
|
825
|
+
data: string | Record<string, unknown>;
|
780
826
|
}
|
781
827
|
/**
|
782
828
|
* @hidden
|
@@ -819,7 +865,7 @@ export namespace externalAppCardActions {
|
|
819
865
|
* Delegates an Adaptive Card Action.Submit request to the host for the application with the provided app ID
|
820
866
|
* @internal
|
821
867
|
* Limited to Microsoft-internal use
|
822
|
-
* @param appId ID of the application the request is intended for
|
868
|
+
* @param appId ID of the application the request is intended for. This must be a UUID
|
823
869
|
* @param actionSubmitPayload The Adaptive Card Action.Submit payload
|
824
870
|
* @param cardActionsConfig The card actions configuration. This indicates which subtypes should be handled by this API
|
825
871
|
* @returns Promise that resolves when the request is completed and rejects with ActionSubmitError if the request fails
|
@@ -831,11 +877,11 @@ export namespace externalAppCardActions {
|
|
831
877
|
* Delegates an Adaptive Card Action.OpenUrl request to the host for the application with the provided app ID
|
832
878
|
* @internal
|
833
879
|
* Limited to Microsoft-internal use
|
834
|
-
* @param appId ID of the application the request is intended for
|
880
|
+
* @param appId ID of the application the request is intended for. This must be a UUID
|
835
881
|
* @param url The URL to open
|
836
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
|
837
883
|
*/
|
838
|
-
function processActionOpenUrl(appId: string, url:
|
884
|
+
function processActionOpenUrl(appId: string, url: URL): Promise<ActionOpenUrlType>;
|
839
885
|
/**
|
840
886
|
* @hidden
|
841
887
|
* Checks if the externalAppCardActions capability is supported by the host
|
@@ -1823,6 +1869,13 @@ export namespace meetingRoom {
|
|
1823
1869
|
export {};
|
1824
1870
|
}
|
1825
1871
|
|
1872
|
+
/**
|
1873
|
+
* @hidden
|
1874
|
+
* Hidden from Docs
|
1875
|
+
*
|
1876
|
+
* @internal
|
1877
|
+
* Limited to Microsoft-internal use
|
1878
|
+
*/
|
1826
1879
|
export namespace notifications {
|
1827
1880
|
/**
|
1828
1881
|
* @hidden
|
@@ -7290,6 +7343,13 @@ export namespace meeting {
|
|
7290
7343
|
function updateMicState(micState: MicState): void;
|
7291
7344
|
}
|
7292
7345
|
|
7346
|
+
/**
|
7347
|
+
* @hidden
|
7348
|
+
* Hidden from Docs
|
7349
|
+
*
|
7350
|
+
* @internal
|
7351
|
+
* Limited to Microsoft-internal use
|
7352
|
+
*/
|
7293
7353
|
export namespace monetization {
|
7294
7354
|
/**
|
7295
7355
|
* @hidden
|
@@ -7566,6 +7626,9 @@ export namespace teamsCore {
|
|
7566
7626
|
function isSupported(): boolean;
|
7567
7627
|
}
|
7568
7628
|
|
7629
|
+
/**
|
7630
|
+
* Allows your app to add a people picker enabling users to search for and select people in their organization.
|
7631
|
+
*/
|
7569
7632
|
export namespace people {
|
7570
7633
|
/** Select people callback function type */
|
7571
7634
|
type selectPeopleCallbackFunctionType = (error: SdkError, people: PeoplePickerResult[]) => void;
|
@@ -8573,6 +8636,130 @@ export namespace appInitialization {
|
|
8573
8636
|
function notifyExpectedFailure(expectedFailureRequest: IExpectedFailureRequest): void;
|
8574
8637
|
}
|
8575
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
|
+
|
8576
8763
|
/** Execute deep link on complete function type */
|
8577
8764
|
export type executeDeepLinkOnCompleteFunctionType = (status: boolean, reason?: string) => void;
|
8578
8765
|
/** Callback function type */
|
package/dist/MicrosoftTeams.js
CHANGED
@@ -889,6 +889,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
889
889
|
tasks: () => (/* reexport */ tasks),
|
890
890
|
teams: () => (/* reexport */ teams),
|
891
891
|
teamsCore: () => (/* reexport */ teamsCore),
|
892
|
+
thirdPartyCloudStorage: () => (/* reexport */ thirdPartyCloudStorage),
|
892
893
|
uploadCustomApp: () => (/* reexport */ uploadCustomApp),
|
893
894
|
version: () => (/* reexport */ version),
|
894
895
|
videoEffects: () => (/* reexport */ videoEffects),
|
@@ -2433,7 +2434,7 @@ var _minRuntimeConfigToUninitialize = {
|
|
2433
2434
|
* @hidden
|
2434
2435
|
* Package version.
|
2435
2436
|
*/
|
2436
|
-
var version = "2.
|
2437
|
+
var version = "2.19.0-beta.0";
|
2437
2438
|
|
2438
2439
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
2439
2440
|
|
@@ -8426,6 +8427,13 @@ var meeting;
|
|
8426
8427
|
|
8427
8428
|
|
8428
8429
|
|
8430
|
+
/**
|
8431
|
+
* @hidden
|
8432
|
+
* Hidden from Docs
|
8433
|
+
*
|
8434
|
+
* @internal
|
8435
|
+
* Limited to Microsoft-internal use
|
8436
|
+
*/
|
8429
8437
|
var monetization;
|
8430
8438
|
(function (monetization) {
|
8431
8439
|
/**
|
@@ -8758,6 +8766,9 @@ var teamsCore;
|
|
8758
8766
|
|
8759
8767
|
|
8760
8768
|
|
8769
|
+
/**
|
8770
|
+
* Allows your app to add a people picker enabling users to search for and select people in their organization.
|
8771
|
+
*/
|
8761
8772
|
var people;
|
8762
8773
|
(function (people_1) {
|
8763
8774
|
/**
|
@@ -10699,6 +10710,149 @@ var appInitialization;
|
|
10699
10710
|
appInitialization.notifyExpectedFailure = notifyExpectedFailure;
|
10700
10711
|
})(appInitialization || (appInitialization = {}));
|
10701
10712
|
|
10713
|
+
;// CONCATENATED MODULE: ./src/public/thirdPartyCloudStorage.ts
|
10714
|
+
|
10715
|
+
|
10716
|
+
|
10717
|
+
|
10718
|
+
|
10719
|
+
|
10720
|
+
|
10721
|
+
var Files3PLogger = getLogger('thirdPartyCloudStorage');
|
10722
|
+
/**
|
10723
|
+
* Extended files API 3P storage providers, features like sending Blob from Teams to 3P app on user
|
10724
|
+
* actions like drag and drop to compose
|
10725
|
+
* @beta
|
10726
|
+
*/
|
10727
|
+
var thirdPartyCloudStorage;
|
10728
|
+
(function (thirdPartyCloudStorage) {
|
10729
|
+
/** Get context callback function type */
|
10730
|
+
var files = [];
|
10731
|
+
var helper = {
|
10732
|
+
fileType: '',
|
10733
|
+
assembleAttachment: [],
|
10734
|
+
};
|
10735
|
+
var lastChunkVal = true; // setting it to true so that the very first file and first chunk does not fail
|
10736
|
+
var callback = null;
|
10737
|
+
/**
|
10738
|
+
* Get drag-and-drop files using a callback.
|
10739
|
+
*
|
10740
|
+
* @param {string} dragAndDropInput - Teams thread id or Teams conversation id from a Teams chat/channel
|
10741
|
+
* @param {DragAndDropFileCallback} dragAndDropFileCallback - callback
|
10742
|
+
* A callback function to handle the result of the operation
|
10743
|
+
* @beta
|
10744
|
+
*/
|
10745
|
+
function getDragAndDropFiles(dragAndDropInput, dragAndDropFileCallback) {
|
10746
|
+
if (!dragAndDropFileCallback) {
|
10747
|
+
throw new Error('[getDragAndDropFiles] Callback cannot be null');
|
10748
|
+
}
|
10749
|
+
if (!dragAndDropInput || dragAndDropInput === '') {
|
10750
|
+
var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
|
10751
|
+
dragAndDropFileCallback([], invalidInput);
|
10752
|
+
return;
|
10753
|
+
}
|
10754
|
+
internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
|
10755
|
+
if (!isSupported()) {
|
10756
|
+
throw errorNotSupportedOnPlatform;
|
10757
|
+
}
|
10758
|
+
if (callback) {
|
10759
|
+
callback = null;
|
10760
|
+
throw new Error('getDragAndDropFiles cannot be called twice');
|
10761
|
+
}
|
10762
|
+
else {
|
10763
|
+
callback = dragAndDropFileCallback;
|
10764
|
+
}
|
10765
|
+
lastChunkVal = true;
|
10766
|
+
sendMessageToParent('thirdPartyCloudStorage.getDragAndDropFiles', [dragAndDropInput], handleGetDragAndDropFilesCallbackRequest);
|
10767
|
+
}
|
10768
|
+
thirdPartyCloudStorage.getDragAndDropFiles = getDragAndDropFiles;
|
10769
|
+
function handleGetDragAndDropFilesCallbackRequest(fileResult) {
|
10770
|
+
if (callback) {
|
10771
|
+
if (fileResult && fileResult.error) {
|
10772
|
+
callback([], fileResult.error);
|
10773
|
+
callback = null;
|
10774
|
+
}
|
10775
|
+
else {
|
10776
|
+
if (fileResult && fileResult.fileChunk) {
|
10777
|
+
try {
|
10778
|
+
if (!lastChunkVal && fileResult.fileChunk.chunkSequence === 0) {
|
10779
|
+
// last chunk value was false
|
10780
|
+
Files3PLogger("Last chunk is not received or 'endOfFile' value for previous chunk was not set to true");
|
10781
|
+
lastChunkVal = true; // for next iteration
|
10782
|
+
callback([], {
|
10783
|
+
errorCode: ErrorCode.INTERNAL_ERROR,
|
10784
|
+
message: 'error occurred while receiving data',
|
10785
|
+
});
|
10786
|
+
files = [];
|
10787
|
+
callback = null;
|
10788
|
+
}
|
10789
|
+
var assemble = decodeAttachment(fileResult.fileChunk, fileResult.fileType);
|
10790
|
+
if (assemble) {
|
10791
|
+
helper.assembleAttachment.push(assemble);
|
10792
|
+
}
|
10793
|
+
else {
|
10794
|
+
Files3PLogger("Received a null assemble attachment for when decoding chunk sequence ".concat(fileResult.fileChunk.chunkSequence, "; not including the chunk in the assembled file."));
|
10795
|
+
callback
|
10796
|
+
? callback([], { errorCode: ErrorCode.INTERNAL_ERROR, message: 'error occurred while receiving data' })
|
10797
|
+
: (callback = null);
|
10798
|
+
files = [];
|
10799
|
+
callback = null;
|
10800
|
+
lastChunkVal = true;
|
10801
|
+
}
|
10802
|
+
// we will store this value to determine whether we received the last chunk of the previous file
|
10803
|
+
lastChunkVal = fileResult.fileChunk.endOfFile;
|
10804
|
+
if (fileResult.fileChunk.endOfFile) {
|
10805
|
+
var fileBlob = createFile(helper.assembleAttachment, helper.fileType);
|
10806
|
+
if (fileBlob) {
|
10807
|
+
// Convert blob to File
|
10808
|
+
var receivedFile = new File([fileBlob], fileResult.fileName, {
|
10809
|
+
type: fileBlob.type,
|
10810
|
+
});
|
10811
|
+
files.push(receivedFile);
|
10812
|
+
}
|
10813
|
+
if (fileResult.isLastFile && callback) {
|
10814
|
+
callback(files, fileResult.error);
|
10815
|
+
files = [];
|
10816
|
+
callback = null;
|
10817
|
+
lastChunkVal = true;
|
10818
|
+
}
|
10819
|
+
helper = {
|
10820
|
+
fileType: '',
|
10821
|
+
assembleAttachment: [],
|
10822
|
+
};
|
10823
|
+
}
|
10824
|
+
}
|
10825
|
+
catch (e) {
|
10826
|
+
if (callback) {
|
10827
|
+
callback([], { errorCode: ErrorCode.INTERNAL_ERROR, message: e });
|
10828
|
+
files = [];
|
10829
|
+
callback = null;
|
10830
|
+
lastChunkVal = true;
|
10831
|
+
}
|
10832
|
+
}
|
10833
|
+
}
|
10834
|
+
else {
|
10835
|
+
callback([], { errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' });
|
10836
|
+
files = [];
|
10837
|
+
callback = null;
|
10838
|
+
lastChunkVal = true;
|
10839
|
+
}
|
10840
|
+
}
|
10841
|
+
}
|
10842
|
+
}
|
10843
|
+
/**
|
10844
|
+
* Checks if the thirdPartyCloudStorage capability is supported by the host
|
10845
|
+
* @returns boolean to represent whether the thirdPartyCloudStorage capability is supported
|
10846
|
+
*
|
10847
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
10848
|
+
* @beta
|
10849
|
+
*/
|
10850
|
+
function isSupported() {
|
10851
|
+
return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.thirdPartyCloudStorage ? true : false;
|
10852
|
+
}
|
10853
|
+
thirdPartyCloudStorage.isSupported = isSupported;
|
10854
|
+
})(thirdPartyCloudStorage || (thirdPartyCloudStorage = {}));
|
10855
|
+
|
10702
10856
|
;// CONCATENATED MODULE: ./src/public/publicAPIs.ts
|
10703
10857
|
|
10704
10858
|
|
@@ -11996,6 +12150,7 @@ var marketplace;
|
|
11996
12150
|
|
11997
12151
|
|
11998
12152
|
|
12153
|
+
|
11999
12154
|
|
12000
12155
|
|
12001
12156
|
|
@@ -12077,7 +12232,7 @@ var externalAppAuthentication;
|
|
12077
12232
|
* 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.
|
12078
12233
|
* @internal
|
12079
12234
|
* Limited to Microsoft-internal use
|
12080
|
-
* @param appId ID of the application backend to which the request and authentication response should be sent
|
12235
|
+
* @param appId ID of the application backend to which the request and authentication response should be sent. This must be a UUID
|
12081
12236
|
* @param authenticateParameters Parameters for the authentication pop-up
|
12082
12237
|
* @param originalRequestInfo Information about the original request that should be resent
|
12083
12238
|
* @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
|
@@ -12092,7 +12247,7 @@ var externalAppAuthentication;
|
|
12092
12247
|
return sendMessageToParentAsync('externalAppAuthentication.authenticateAndResendRequest', [
|
12093
12248
|
appId,
|
12094
12249
|
originalRequestInfo,
|
12095
|
-
authenticateParameters.url,
|
12250
|
+
authenticateParameters.url.href,
|
12096
12251
|
authenticateParameters.width,
|
12097
12252
|
authenticateParameters.height,
|
12098
12253
|
authenticateParameters.isExternal,
|
@@ -12114,7 +12269,7 @@ var externalAppAuthentication;
|
|
12114
12269
|
* Signals to the host to perform SSO authentication for the application specified by the app ID
|
12115
12270
|
* @internal
|
12116
12271
|
* Limited to Microsoft-internal use
|
12117
|
-
* @param appId ID of the application backend for which the host should attempt SSO authentication
|
12272
|
+
* @param appId ID of the application backend for which the host should attempt SSO authentication. This must be a UUID
|
12118
12273
|
* @param authTokenRequest Parameters for SSO authentication
|
12119
12274
|
* @returns A promise that resolves when authentication and succeeds and rejects with InvokeError on failure
|
12120
12275
|
*/
|
@@ -12125,7 +12280,6 @@ var externalAppAuthentication;
|
|
12125
12280
|
}
|
12126
12281
|
return sendMessageToParentAsync('externalAppAuthentication.authenticateWithSSO', [
|
12127
12282
|
appId,
|
12128
|
-
authTokenRequest.resources,
|
12129
12283
|
authTokenRequest.claims,
|
12130
12284
|
authTokenRequest.silent,
|
12131
12285
|
]).then(function (_a) {
|
@@ -12142,7 +12296,7 @@ var externalAppAuthentication;
|
|
12142
12296
|
* 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
|
12143
12297
|
* @internal
|
12144
12298
|
* Limited to Microsoft-internal use
|
12145
|
-
* @param appId ID of the application backend for which the host should attempt SSO authentication and resend the request and authentication response
|
12299
|
+
* @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.
|
12146
12300
|
* @param authTokenRequest Parameters for SSO authentication
|
12147
12301
|
* @param originalRequestInfo Information about the original request that should be resent
|
12148
12302
|
* @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
|
@@ -12153,7 +12307,7 @@ var externalAppAuthentication;
|
|
12153
12307
|
throw errorNotSupportedOnPlatform;
|
12154
12308
|
}
|
12155
12309
|
validateOriginalRequestInfo(originalRequestInfo);
|
12156
|
-
return sendMessageToParentAsync('externalAppAuthentication.authenticateWithSSOAndResendRequest', [appId, originalRequestInfo, authTokenRequest.
|
12310
|
+
return sendMessageToParentAsync('externalAppAuthentication.authenticateWithSSOAndResendRequest', [appId, originalRequestInfo, authTokenRequest.claims, authTokenRequest.silent]).then(function (_a) {
|
12157
12311
|
var wasSuccessful = _a[0], response = _a[1];
|
12158
12312
|
if (wasSuccessful && response.responseType != null) {
|
12159
12313
|
return response;
|
@@ -12216,9 +12370,9 @@ var externalAppCardActions;
|
|
12216
12370
|
*/
|
12217
12371
|
var ActionOpenUrlErrorCode;
|
12218
12372
|
(function (ActionOpenUrlErrorCode) {
|
12373
|
+
ActionOpenUrlErrorCode["INTERNAL_ERROR"] = "INTERNAL_ERROR";
|
12219
12374
|
ActionOpenUrlErrorCode["INVALID_LINK"] = "INVALID_LINK";
|
12220
12375
|
ActionOpenUrlErrorCode["NOT_SUPPORTED"] = "NOT_SUPPORTED";
|
12221
|
-
ActionOpenUrlErrorCode["INTERNAL_ERROR"] = "INTERNAL_ERROR";
|
12222
12376
|
})(ActionOpenUrlErrorCode = externalAppCardActions.ActionOpenUrlErrorCode || (externalAppCardActions.ActionOpenUrlErrorCode = {}));
|
12223
12377
|
/**
|
12224
12378
|
* @hidden
|
@@ -12236,7 +12390,7 @@ var externalAppCardActions;
|
|
12236
12390
|
* Delegates an Adaptive Card Action.Submit request to the host for the application with the provided app ID
|
12237
12391
|
* @internal
|
12238
12392
|
* Limited to Microsoft-internal use
|
12239
|
-
* @param appId ID of the application the request is intended for
|
12393
|
+
* @param appId ID of the application the request is intended for. This must be a UUID
|
12240
12394
|
* @param actionSubmitPayload The Adaptive Card Action.Submit payload
|
12241
12395
|
* @param cardActionsConfig The card actions configuration. This indicates which subtypes should be handled by this API
|
12242
12396
|
* @returns Promise that resolves when the request is completed and rejects with ActionSubmitError if the request fails
|
@@ -12264,7 +12418,7 @@ var externalAppCardActions;
|
|
12264
12418
|
* Delegates an Adaptive Card Action.OpenUrl request to the host for the application with the provided app ID
|
12265
12419
|
* @internal
|
12266
12420
|
* Limited to Microsoft-internal use
|
12267
|
-
* @param appId ID of the application the request is intended for
|
12421
|
+
* @param appId ID of the application the request is intended for. This must be a UUID
|
12268
12422
|
* @param url The URL to open
|
12269
12423
|
* @returns Promise that resolves to ActionOpenUrlType indicating the type of URL that was opened on success and rejects with ActionOpenUrlError if the request fails
|
12270
12424
|
*/
|
@@ -12273,7 +12427,7 @@ var externalAppCardActions;
|
|
12273
12427
|
if (!isSupported()) {
|
12274
12428
|
throw errorNotSupportedOnPlatform;
|
12275
12429
|
}
|
12276
|
-
return sendMessageToParentAsync('externalAppCardActions.processActionOpenUrl', [appId, url]).then(function (_a) {
|
12430
|
+
return sendMessageToParentAsync('externalAppCardActions.processActionOpenUrl', [appId, url.href]).then(function (_a) {
|
12277
12431
|
var error = _a[0], response = _a[1];
|
12278
12432
|
if (error) {
|
12279
12433
|
throw error;
|
@@ -12974,6 +13128,13 @@ var meetingRoom;
|
|
12974
13128
|
|
12975
13129
|
|
12976
13130
|
|
13131
|
+
/**
|
13132
|
+
* @hidden
|
13133
|
+
* Hidden from Docs
|
13134
|
+
*
|
13135
|
+
* @internal
|
13136
|
+
* Limited to Microsoft-internal use
|
13137
|
+
*/
|
12977
13138
|
var notifications;
|
12978
13139
|
(function (notifications) {
|
12979
13140
|
/**
|