@microsoft/teams-js 2.0.0-beta.2 → 2.0.0-beta.3-dev.2

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.
@@ -1,26 +1,5 @@
1
1
  // Generated by dts-bundle v0.7.3
2
2
 
3
- /**
4
- * @deprecated
5
- * As of 2.0.0-beta.1.
6
- */
7
- /**
8
- * @deprecated
9
- * As of 2.0.0-beta.1.
10
- */
11
- /**
12
- * @deprecated
13
- * As of 2.0.0-beta.1.
14
- */
15
- /**
16
- * @deprecated
17
- * As of 2.0.0-beta.1.
18
- */
19
- /**
20
- * @deprecated
21
- * As of 2.0.0-beta.1.
22
- */
23
-
24
3
  /**
25
4
  * @hidden
26
5
  * Namespace to interact with bots using the SDK.
@@ -569,23 +548,51 @@ export namespace files {
569
548
  * ------
570
549
  * Cloud storage providers registered with Microsoft Teams
571
550
  */
572
- enum CloudStorageProvider {
551
+ export enum CloudStorageProvider {
573
552
  Dropbox = "DROPBOX",
574
553
  Box = "BOX",
575
554
  Sharefile = "SHAREFILE",
576
555
  GoogleDrive = "GOOGLEDRIVE",
577
- Egnyte = "EGNYTE"
556
+ Egnyte = "EGNYTE",
557
+ SharePoint = "SharePoint"
558
+ }
559
+ interface IWopiThumbnail {
560
+ size: number;
561
+ url: string;
562
+ }
563
+ interface IWopiService {
564
+ name: string;
565
+ description: string;
566
+ thumbnails: IWopiThumbnail[];
578
567
  }
579
568
  /**
580
569
  * @hidden
581
570
  * Hide from docs
582
571
  * ------
583
- * Cloud storage provider integration type
572
+ *
573
+ * External third-party cloud storages providers interface
574
+ */
575
+ export interface IExternalProvider extends IWopiService {
576
+ providerType: CloudStorageProviderType;
577
+ providerCode: CloudStorageProvider;
578
+ }
579
+ /**
580
+ * @hidden
581
+ * Hide from docs
582
+ *
583
+ * Cloud storage provider type enums
584
584
  */
585
- enum CloudStorageProviderType {
585
+ export enum CloudStorageProviderType {
586
586
  Sharepoint = 0,
587
587
  WopiIntegration = 1,
588
- Google = 2
588
+ Google = 2,
589
+ OneDrive = 3,
590
+ Recent = 4,
591
+ Aggregate = 5,
592
+ FileSystem = 6,
593
+ Search = 7,
594
+ AllFiles = 8,
595
+ SharedWithMe = 9
589
596
  }
590
597
  /**
591
598
  * @hidden
@@ -593,7 +600,7 @@ export namespace files {
593
600
  * ------
594
601
  * Cloud storage folder interface
595
602
  */
596
- interface CloudStorageFolder {
603
+ export interface CloudStorageFolder {
597
604
  /**
598
605
  * @hidden
599
606
  * ID of the cloud storage folder
@@ -651,7 +658,7 @@ export namespace files {
651
658
  * ------
652
659
  * Cloud storage item interface
653
660
  */
654
- interface CloudStorageFolderItem {
661
+ export interface CloudStorageFolderItem {
655
662
  /**
656
663
  * @hidden
657
664
  * ID of the item in the provider
@@ -693,6 +700,73 @@ export namespace files {
693
700
  */
694
701
  accessToken?: string;
695
702
  }
703
+ /**
704
+ * @hidden
705
+ * Hide from docs
706
+ *
707
+ * Files entity user interface
708
+ */
709
+ export interface IFilesEntityUser {
710
+ /**
711
+ * User name.
712
+ */
713
+ displayName: string;
714
+ /**
715
+ * User email.
716
+ */
717
+ email: string;
718
+ /**
719
+ * User MRI.
720
+ */
721
+ mri: string;
722
+ }
723
+ /**
724
+ * @hidden
725
+ * Hide from docs
726
+ *
727
+ * Special Document Library enum
728
+ */
729
+ export enum SpecialDocumentLibraryType {
730
+ ClassMaterials = "classMaterials"
731
+ }
732
+ /**
733
+ * @hidden
734
+ * Hide from docs
735
+ *
736
+ * Document Library Access enum
737
+ */
738
+ export enum DocumentLibraryAccessType {
739
+ Readonly = "readonly"
740
+ }
741
+ /**
742
+ * @hidden
743
+ * Hide from docs
744
+ *
745
+ * SharePoint file interface
746
+ */
747
+ export interface ISharePointFile {
748
+ siteId?: string;
749
+ siteUrl: string;
750
+ objectId: string;
751
+ objectUrl: string;
752
+ openInWindowFileUrl: string;
753
+ title: string;
754
+ isFolder: boolean;
755
+ serverRelativeUrl: string;
756
+ lastModifiedByUser: IFilesEntityUser;
757
+ lastModifiedTime: string;
758
+ sentByUser: IFilesEntityUser;
759
+ createdByUser: IFilesEntityUser;
760
+ createdTime: string;
761
+ size: number;
762
+ type: string;
763
+ spItemUrl?: string;
764
+ libraryType?: SpecialDocumentLibraryType;
765
+ accessType?: DocumentLibraryAccessType;
766
+ etag?: string;
767
+ remoteItem?: string;
768
+ listUrl?: string;
769
+ }
696
770
  /**
697
771
  * @hidden
698
772
  * Hide from docs
@@ -701,7 +775,7 @@ export namespace files {
701
775
  *
702
776
  * @param channelId - ID of the channel whose cloud storage folders should be retrieved
703
777
  */
704
- function getCloudStorageFolders(channelId: string): Promise<CloudStorageFolder[]>;
778
+ export function getCloudStorageFolders(channelId: string): Promise<CloudStorageFolder[]>;
705
779
  /**
706
780
  * @hidden
707
781
  * Hide from docs
@@ -709,7 +783,7 @@ export namespace files {
709
783
  * Initiates the add cloud storage folder flow
710
784
  * @param channelId - ID of the channel to add cloud storage folder
711
785
  */
712
- function addCloudStorageFolder(channelId: string): Promise<[boolean, CloudStorageFolder[]]>;
786
+ export function addCloudStorageFolder(channelId: string): Promise<[boolean, CloudStorageFolder[]]>;
713
787
  /**
714
788
  * @hidden
715
789
  * Hide from docs
@@ -719,7 +793,7 @@ export namespace files {
719
793
  * @param channelId - ID of the channel where folder is to be deleted
720
794
  * @param folderToDelete - cloud storage folder to be deleted
721
795
  */
722
- function deleteCloudStorageFolder(channelId: string, folderToDelete: CloudStorageFolder): Promise<boolean>;
796
+ export function deleteCloudStorageFolder(channelId: string, folderToDelete: CloudStorageFolder): Promise<boolean>;
723
797
  /**
724
798
  * @hidden
725
799
  * Hide from docs
@@ -730,7 +804,7 @@ export namespace files {
730
804
  * @param providerCode - Code of the cloud storage folder provider
731
805
  * @param callback - Callback that will be triggered post contents are loaded
732
806
  */
733
- function getCloudStorageFolderContents(folder: CloudStorageFolder | CloudStorageFolderItem, providerCode: CloudStorageProvider): Promise<CloudStorageFolderItem[]>;
807
+ export function getCloudStorageFolderContents(folder: CloudStorageFolder | CloudStorageFolderItem, providerCode: CloudStorageProvider): Promise<CloudStorageFolderItem[]>;
734
808
  /**
735
809
  * @hidden
736
810
  * Hide from docs
@@ -741,7 +815,7 @@ export namespace files {
741
815
  * @param providerCode - Code of the cloud storage folder provider
742
816
  * @param fileOpenPreference - Whether file should be opened in web/inline
743
817
  */
744
- function openCloudStorageFile(file: CloudStorageFolderItem, providerCode: CloudStorageProvider, fileOpenPreference?: FileOpenPreference.Web | FileOpenPreference.Inline): void;
818
+ export function openCloudStorageFile(file: CloudStorageFolderItem, providerCode: CloudStorageProvider, fileOpenPreference?: FileOpenPreference.Web | FileOpenPreference.Inline): void;
745
819
  /**
746
820
  * @hidden
747
821
  * Hide from docs.
@@ -750,8 +824,23 @@ export namespace files {
750
824
  *
751
825
  * @param file - The file to preview.
752
826
  */
753
- function openFilePreview(filePreviewParameters: FilePreviewParameters): void;
754
- function isSupported(): boolean;
827
+ export function openFilePreview(filePreviewParameters: FilePreviewParameters): void;
828
+ /**
829
+ * @hidden
830
+ * Allow 1st party apps to call this function to get the external
831
+ * third party cloud storage accounts that the tenant supports
832
+ * @param excludeAddedProviders: return a list of support third party
833
+ * cloud storages that hasn't been added yet.
834
+ */
835
+ export function getExternalProviders(excludeAddedProviders?: boolean): Promise<IExternalProvider[]>;
836
+ /**
837
+ * @hidden
838
+ * Allow 1st party apps to call this function to move files
839
+ * among SharePoint and third party cloud storages.
840
+ */
841
+ export function copyMoveFiles(selectedFiles: CloudStorageFolderItem[] | ISharePointFile[], providerCode: CloudStorageProvider, destinationFolder: CloudStorageFolderItem | ISharePointFile, destinationProviderCode: CloudStorageProvider, isMove?: boolean): Promise<void>;
842
+ export function isSupported(): boolean;
843
+ export {};
755
844
  }
756
845
 
757
846
  /**
@@ -2723,7 +2812,7 @@ export namespace dialog {
2723
2812
  * @param dialogInfo - An object containing the parameters of the dialog module
2724
2813
  * @param submitHandler - Handler to call when the task module is completed
2725
2814
  */
2726
- function open(dialogInfo: DialogInfo, submitHandler?: (err: string, result: string) => void): IAppWindow;
2815
+ function open(dialogInfo: DialogInfo, submitHandler?: (err: string, result: string | object) => void): IAppWindow;
2727
2816
  /**
2728
2817
  * Update height/width dialog info properties.
2729
2818
  *
@@ -4625,7 +4714,7 @@ export namespace tasks {
4625
4714
  * @param taskInfo - An object containing the parameters of the task module
4626
4715
  * @param submitHandler - Handler to call when the task module is completed
4627
4716
  */
4628
- function startTask(taskInfo: TaskInfo, submitHandler?: (err: string, result: string) => void): IAppWindow;
4717
+ function startTask(taskInfo: TaskInfo, submitHandler?: (err: string, result: string | object) => void): IAppWindow;
4629
4718
  /**
4630
4719
  * @deprecated
4631
4720
  * As of 2.0.0-beta.1, please use {@link dialog.resize dialog.resize(dialogInfo: DialogInfo): void} instead.
@@ -4647,24 +4736,3 @@ export namespace tasks {
4647
4736
  function submitTask(result?: string | object, appIds?: string | string[]): void;
4648
4737
  }
4649
4738
 
4650
- /**
4651
- * @deprecated
4652
- * As of 2.0.0-beta.1.
4653
- */
4654
- /**
4655
- * @deprecated
4656
- * As of 2.0.0-beta.1.
4657
- */
4658
- /**
4659
- * @deprecated
4660
- * As of 2.0.0-beta.1.
4661
- */
4662
- /**
4663
- * @deprecated
4664
- * As of 2.0.0-beta.1.
4665
- */
4666
- /**
4667
- * @deprecated
4668
- * As of 2.0.0-beta.1.
4669
- */
4670
-
@@ -395,7 +395,7 @@ __webpack_require__.d(__webpack_exports__, {
395
395
  });
396
396
 
397
397
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
398
- var version = '2.0.0-beta.2';
398
+ var version = '2.0.0-beta.3-dev.2';
399
399
  /**
400
400
  * @hidden
401
401
  * The SDK version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
@@ -803,7 +803,8 @@ function ensureInitialized() {
803
803
  }
804
804
  }
805
805
  if (!found) {
806
- throw new Error("This call is not allowed in the '" + GlobalVars.frameContext + "' context");
806
+ throw new Error("This call is only allowed in following contexts: " + JSON.stringify(expectedFrameContexts) + ". " +
807
+ ("Current context: \"" + GlobalVars.frameContext + "\"."));
807
808
  }
808
809
  }
809
810
  }
@@ -5244,6 +5245,7 @@ var settings;
5244
5245
  })(settings || (settings = {}));
5245
5246
 
5246
5247
  ;// CONCATENATED MODULE: ./src/public/tasks.ts
5248
+ /* eslint-disable @typescript-eslint/ban-types */
5247
5249
 
5248
5250
 
5249
5251
  /**
@@ -5290,7 +5292,6 @@ var tasks;
5290
5292
  * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
5291
5293
  * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
5292
5294
  */
5293
- // eslint-disable-next-line
5294
5295
  function submitTask(result, appIds) {
5295
5296
  dialog.submit(result, appIds);
5296
5297
  }
@@ -5346,30 +5347,10 @@ var tasks;
5346
5347
 
5347
5348
 
5348
5349
 
5349
- /**
5350
- * @deprecated
5351
- * As of 2.0.0-beta.1.
5352
- */
5353
5350
 
5354
- /**
5355
- * @deprecated
5356
- * As of 2.0.0-beta.1.
5357
- */
5358
5351
 
5359
- /**
5360
- * @deprecated
5361
- * As of 2.0.0-beta.1.
5362
- */
5363
5352
 
5364
- /**
5365
- * @deprecated
5366
- * As of 2.0.0-beta.1.
5367
- */
5368
5353
 
5369
- /**
5370
- * @deprecated
5371
- * As of 2.0.0-beta.1.
5372
- */
5373
5354
 
5374
5355
 
5375
5356
  ;// CONCATENATED MODULE: ./src/private/files.ts
@@ -5400,19 +5381,47 @@ var files;
5400
5381
  CloudStorageProvider["Sharefile"] = "SHAREFILE";
5401
5382
  CloudStorageProvider["GoogleDrive"] = "GOOGLEDRIVE";
5402
5383
  CloudStorageProvider["Egnyte"] = "EGNYTE";
5384
+ CloudStorageProvider["SharePoint"] = "SharePoint";
5403
5385
  })(CloudStorageProvider = files.CloudStorageProvider || (files.CloudStorageProvider = {}));
5404
5386
  /**
5405
5387
  * @hidden
5406
5388
  * Hide from docs
5407
- * ------
5408
- * Cloud storage provider integration type
5389
+ *
5390
+ * Cloud storage provider type enums
5409
5391
  */
5410
5392
  var CloudStorageProviderType;
5411
5393
  (function (CloudStorageProviderType) {
5412
5394
  CloudStorageProviderType[CloudStorageProviderType["Sharepoint"] = 0] = "Sharepoint";
5413
5395
  CloudStorageProviderType[CloudStorageProviderType["WopiIntegration"] = 1] = "WopiIntegration";
5414
5396
  CloudStorageProviderType[CloudStorageProviderType["Google"] = 2] = "Google";
5397
+ CloudStorageProviderType[CloudStorageProviderType["OneDrive"] = 3] = "OneDrive";
5398
+ CloudStorageProviderType[CloudStorageProviderType["Recent"] = 4] = "Recent";
5399
+ CloudStorageProviderType[CloudStorageProviderType["Aggregate"] = 5] = "Aggregate";
5400
+ CloudStorageProviderType[CloudStorageProviderType["FileSystem"] = 6] = "FileSystem";
5401
+ CloudStorageProviderType[CloudStorageProviderType["Search"] = 7] = "Search";
5402
+ CloudStorageProviderType[CloudStorageProviderType["AllFiles"] = 8] = "AllFiles";
5403
+ CloudStorageProviderType[CloudStorageProviderType["SharedWithMe"] = 9] = "SharedWithMe";
5415
5404
  })(CloudStorageProviderType = files.CloudStorageProviderType || (files.CloudStorageProviderType = {}));
5405
+ /**
5406
+ * @hidden
5407
+ * Hide from docs
5408
+ *
5409
+ * Special Document Library enum
5410
+ */
5411
+ var SpecialDocumentLibraryType;
5412
+ (function (SpecialDocumentLibraryType) {
5413
+ SpecialDocumentLibraryType["ClassMaterials"] = "classMaterials";
5414
+ })(SpecialDocumentLibraryType = files.SpecialDocumentLibraryType || (files.SpecialDocumentLibraryType = {}));
5415
+ /**
5416
+ * @hidden
5417
+ * Hide from docs
5418
+ *
5419
+ * Document Library Access enum
5420
+ */
5421
+ var DocumentLibraryAccessType;
5422
+ (function (DocumentLibraryAccessType) {
5423
+ DocumentLibraryAccessType["Readonly"] = "readonly";
5424
+ })(DocumentLibraryAccessType = files.DocumentLibraryAccessType || (files.DocumentLibraryAccessType = {}));
5416
5425
  /**
5417
5426
  * @hidden
5418
5427
  * Hide from docs
@@ -5424,7 +5433,7 @@ var files;
5424
5433
  function getCloudStorageFolders(channelId) {
5425
5434
  return new Promise(function (resolve) {
5426
5435
  ensureInitialized(FrameContexts.content);
5427
- if (!channelId || channelId.length == 0) {
5436
+ if (!channelId || channelId.length === 0) {
5428
5437
  throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');
5429
5438
  }
5430
5439
  resolve(sendAndHandleSdkError('files.getCloudStorageFolders', channelId));
@@ -5441,7 +5450,7 @@ var files;
5441
5450
  function addCloudStorageFolder(channelId) {
5442
5451
  return new Promise(function (resolve) {
5443
5452
  ensureInitialized(FrameContexts.content);
5444
- if (!channelId || channelId.length == 0) {
5453
+ if (!channelId || channelId.length === 0) {
5445
5454
  throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');
5446
5455
  }
5447
5456
  resolve(sendMessageToParentAsync('files.addCloudStorageFolder', [channelId]));
@@ -5550,6 +5559,46 @@ var files;
5550
5559
  sendMessageToParent('openFilePreview', params);
5551
5560
  }
5552
5561
  files.openFilePreview = openFilePreview;
5562
+ /**
5563
+ * @hidden
5564
+ * Allow 1st party apps to call this function to get the external
5565
+ * third party cloud storage accounts that the tenant supports
5566
+ * @param excludeAddedProviders: return a list of support third party
5567
+ * cloud storages that hasn't been added yet.
5568
+ */
5569
+ function getExternalProviders(excludeAddedProviders) {
5570
+ if (excludeAddedProviders === void 0) { excludeAddedProviders = false; }
5571
+ return new Promise(function (resolve) {
5572
+ ensureInitialized(FrameContexts.content);
5573
+ resolve(sendAndHandleSdkError('files.getExternalProviders', excludeAddedProviders));
5574
+ });
5575
+ }
5576
+ files.getExternalProviders = getExternalProviders;
5577
+ /**
5578
+ * @hidden
5579
+ * Allow 1st party apps to call this function to move files
5580
+ * among SharePoint and third party cloud storages.
5581
+ */
5582
+ function copyMoveFiles(selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove) {
5583
+ if (isMove === void 0) { isMove = false; }
5584
+ return new Promise(function (resolve) {
5585
+ ensureInitialized(FrameContexts.content);
5586
+ if (!selectedFiles || selectedFiles.length === 0) {
5587
+ throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');
5588
+ }
5589
+ if (!providerCode) {
5590
+ throw new Error('[files.copyMoveFiles] providerCode cannot be null or empty');
5591
+ }
5592
+ if (!destinationFolder) {
5593
+ throw new Error('[files.copyMoveFiles] destinationFolder cannot be null or empty');
5594
+ }
5595
+ if (!destinationProviderCode) {
5596
+ throw new Error('[files.copyMoveFiles] destinationProviderCode cannot be null or empty');
5597
+ }
5598
+ resolve(sendAndHandleSdkError('files.copyMoveFiles', selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove));
5599
+ });
5600
+ }
5601
+ files.copyMoveFiles = copyMoveFiles;
5553
5602
  function isSupported() {
5554
5603
  return runtime.supports.files ? true : false;
5555
5604
  }