@microsoft/teams-js 2.30.0 → 2.31.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/dist/esm/_virtual/__polyfill-node.os.js +1 -0
  2. package/dist/esm/_virtual/_polyfill-node.os.js +1 -0
  3. package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js +1 -1
  4. package/dist/esm/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +1 -0
  5. package/dist/esm/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +1 -0
  6. package/dist/esm/packages/teams-js/dts/index.d.ts +2 -0
  7. package/dist/esm/packages/teams-js/dts/internal/VideoFrameTypes.d.ts +78 -0
  8. package/dist/esm/packages/teams-js/dts/internal/appHelpers.d.ts +8 -0
  9. package/dist/esm/packages/teams-js/dts/internal/appIdValidation.d.ts +16 -0
  10. package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +162 -0
  11. package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +146 -0
  12. package/dist/esm/packages/teams-js/dts/internal/deepLinkConstants.d.ts +26 -0
  13. package/dist/esm/packages/teams-js/dts/internal/deepLinkUtilities.d.ts +4 -0
  14. package/dist/esm/packages/teams-js/dts/internal/emailAddressValidation.d.ts +1 -0
  15. package/dist/esm/packages/teams-js/dts/internal/globalVars.d.ts +12 -0
  16. package/dist/esm/packages/teams-js/dts/internal/handlers.d.ts +80 -0
  17. package/dist/esm/packages/teams-js/dts/internal/interfaces.d.ts +47 -0
  18. package/dist/esm/packages/teams-js/dts/internal/internalAPIs.d.ts +61 -0
  19. package/dist/esm/packages/teams-js/dts/internal/marketplaceUtils.d.ts +94 -0
  20. package/dist/esm/packages/teams-js/dts/internal/mediaUtil.d.ts +95 -0
  21. package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +73 -0
  22. package/dist/esm/packages/teams-js/dts/internal/nestedAppAuthUtils.d.ts +105 -0
  23. package/dist/esm/packages/teams-js/dts/internal/profileUtil.d.ts +11 -0
  24. package/dist/esm/packages/teams-js/dts/internal/responseHandler.d.ts +30 -0
  25. package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +344 -0
  26. package/dist/esm/packages/teams-js/dts/internal/typeCheckUtilities.d.ts +1 -0
  27. package/dist/esm/packages/teams-js/dts/internal/utils.d.ts +200 -0
  28. package/dist/esm/packages/teams-js/dts/internal/uuidObject.d.ts +11 -0
  29. package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +6 -0
  30. package/dist/esm/packages/teams-js/dts/internal/videoEffectsUtils.d.ts +31 -0
  31. package/dist/esm/packages/teams-js/dts/internal/videoFrameTick.d.ts +10 -0
  32. package/dist/esm/packages/teams-js/dts/internal/videoPerformanceMonitor.d.ts +54 -0
  33. package/dist/esm/packages/teams-js/dts/internal/videoPerformanceStatistics.d.ts +49 -0
  34. package/dist/esm/packages/teams-js/dts/private/appEntity.d.ts +89 -0
  35. package/dist/esm/packages/teams-js/dts/private/constants.d.ts +9 -0
  36. package/dist/esm/packages/teams-js/dts/private/conversations.d.ts +152 -0
  37. package/dist/esm/packages/teams-js/dts/private/copilot.d.ts +39 -0
  38. package/dist/esm/packages/teams-js/dts/private/externalAppAuthentication.d.ts +378 -0
  39. package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +75 -0
  40. package/dist/esm/packages/teams-js/dts/private/externalAppCardActions.d.ts +112 -0
  41. package/dist/esm/packages/teams-js/dts/private/externalAppCardActionsForCEA.d.ts +49 -0
  42. package/dist/esm/packages/teams-js/dts/private/externalAppCommands.d.ts +123 -0
  43. package/dist/esm/packages/teams-js/dts/private/files.d.ts +758 -0
  44. package/dist/esm/packages/teams-js/dts/private/hostEntity.d.ts +176 -0
  45. package/dist/esm/packages/teams-js/dts/private/index.d.ts +20 -0
  46. package/dist/esm/packages/teams-js/dts/private/interfaces.d.ts +250 -0
  47. package/dist/esm/packages/teams-js/dts/private/logs.d.ts +25 -0
  48. package/dist/esm/packages/teams-js/dts/private/meetingRoom.d.ts +203 -0
  49. package/dist/esm/packages/teams-js/dts/private/messageChannels.d.ts +107 -0
  50. package/dist/esm/packages/teams-js/dts/private/notifications.d.ts +26 -0
  51. package/dist/esm/packages/teams-js/dts/private/otherAppStateChange.d.ts +81 -0
  52. package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +60 -0
  53. package/dist/esm/packages/teams-js/dts/private/remoteCamera.d.ts +298 -0
  54. package/dist/esm/packages/teams-js/dts/private/teams.d.ts +116 -0
  55. package/dist/esm/packages/teams-js/dts/private/videoEffectsEx.d.ts +244 -0
  56. package/dist/esm/packages/teams-js/dts/public/adaptiveCards.d.ts +6 -0
  57. package/dist/esm/packages/teams-js/dts/public/app.d.ts +592 -0
  58. package/dist/esm/packages/teams-js/dts/public/appId.d.ts +33 -0
  59. package/dist/esm/packages/teams-js/dts/public/appInitialization.d.ts +57 -0
  60. package/dist/esm/packages/teams-js/dts/public/appInstallDialog.d.ts +18 -0
  61. package/dist/esm/packages/teams-js/dts/public/appWindow.d.ts +66 -0
  62. package/dist/esm/packages/teams-js/dts/public/authentication.d.ts +409 -0
  63. package/dist/esm/packages/teams-js/dts/public/barCode.d.ts +53 -0
  64. package/dist/esm/packages/teams-js/dts/public/calendar.d.ts +40 -0
  65. package/dist/esm/packages/teams-js/dts/public/call.d.ts +53 -0
  66. package/dist/esm/packages/teams-js/dts/public/chat.d.ts +66 -0
  67. package/dist/esm/packages/teams-js/dts/public/clipboard.d.ts +34 -0
  68. package/dist/esm/packages/teams-js/dts/public/constants.d.ts +179 -0
  69. package/dist/esm/packages/teams-js/dts/public/dialog.d.ts +286 -0
  70. package/dist/esm/packages/teams-js/dts/public/emailAddress.d.ts +12 -0
  71. package/dist/esm/packages/teams-js/dts/public/geoLocation.d.ts +100 -0
  72. package/dist/esm/packages/teams-js/dts/public/index.d.ts +44 -0
  73. package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +1133 -0
  74. package/dist/esm/packages/teams-js/dts/public/liveShareHost.d.ts +221 -0
  75. package/dist/esm/packages/teams-js/dts/public/location.d.ts +86 -0
  76. package/dist/esm/packages/teams-js/dts/public/mail.d.ts +95 -0
  77. package/dist/esm/packages/teams-js/dts/public/marketplace.d.ts +321 -0
  78. package/dist/esm/packages/teams-js/dts/public/media.d.ts +440 -0
  79. package/dist/esm/packages/teams-js/dts/public/meeting.d.ts +906 -0
  80. package/dist/esm/packages/teams-js/dts/public/menus.d.ts +188 -0
  81. package/dist/esm/packages/teams-js/dts/public/monetization.d.ts +58 -0
  82. package/dist/esm/packages/teams-js/dts/public/navigation.d.ts +45 -0
  83. package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +15 -0
  84. package/dist/esm/packages/teams-js/dts/public/pages.d.ts +574 -0
  85. package/dist/esm/packages/teams-js/dts/public/people.d.ts +75 -0
  86. package/dist/esm/packages/teams-js/dts/public/profile.d.ts +127 -0
  87. package/dist/esm/packages/teams-js/dts/public/publicAPIs.d.ts +218 -0
  88. package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +207 -0
  89. package/dist/esm/packages/teams-js/dts/public/search.d.ts +91 -0
  90. package/dist/esm/packages/teams-js/dts/public/secondaryBrowser.d.ts +32 -0
  91. package/dist/esm/packages/teams-js/dts/public/serializable.interface.d.ts +17 -0
  92. package/dist/esm/packages/teams-js/dts/public/settings.d.ts +101 -0
  93. package/dist/esm/packages/teams-js/dts/public/sharing.d.ts +124 -0
  94. package/dist/esm/packages/teams-js/dts/public/stageView.d.ts +104 -0
  95. package/dist/esm/packages/teams-js/dts/public/tasks.d.ts +62 -0
  96. package/dist/esm/packages/teams-js/dts/public/teamsAPIs.d.ts +77 -0
  97. package/dist/esm/packages/teams-js/dts/public/thirdPartyCloudStorage.d.ts +119 -0
  98. package/dist/esm/packages/teams-js/dts/public/version.d.ts +5 -0
  99. package/dist/esm/packages/teams-js/dts/public/videoEffects.d.ts +213 -0
  100. package/dist/esm/packages/teams-js/dts/public/visualMedia.d.ts +192 -0
  101. package/dist/esm/packages/teams-js/dts/public/webStorage.d.ts +27 -0
  102. package/dist/esm/packages/teams-js/src/index.js +1 -1
  103. package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -0
  104. package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
  105. package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
  106. package/dist/esm/packages/teams-js/src/internal/responseHandler.js +1 -0
  107. package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
  108. package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
  109. package/dist/esm/packages/teams-js/src/private/hostEntity.js +1 -1
  110. package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
  111. package/dist/esm/packages/teams-js/src/public/app.js +1 -1
  112. package/dist/esm/packages/teams-js/src/public/appId.js +1 -1
  113. package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -1
  114. package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
  115. package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
  116. package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
  117. package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
  118. package/dist/esm/packages/teams-js/src/public/call.js +1 -1
  119. package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
  120. package/dist/esm/packages/teams-js/src/public/constants.js +1 -1
  121. package/dist/esm/packages/teams-js/src/public/pages.js +1 -1
  122. package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
  123. package/dist/esm/packages/teams-js/src/public/serializable.interface.js +1 -0
  124. package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
  125. package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
  126. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  127. package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
  128. package/dist/umd/MicrosoftTeams.d.ts +10740 -10768
  129. package/dist/umd/MicrosoftTeams.js +1571 -1359
  130. package/dist/umd/MicrosoftTeams.js.map +1 -1
  131. package/dist/umd/MicrosoftTeams.min.js +1 -1
  132. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  133. package/package.json +1 -51
  134. package/dist/esm/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/browser.js +0 -1
@@ -0,0 +1,61 @@
1
+ import { IBaseRuntime, Runtime } from '../public/runtime';
2
+ /**
3
+ * Ensures `initialize` was called. This function does NOT verify that a response from Host was received and initialization completed.
4
+ *
5
+ * `ensureInitializeCalled` should only be used for APIs which:
6
+ * - work in all FrameContexts
7
+ * - are part of a required Capability
8
+ * - are suspected to be used directly after calling `initialize`, potentially without awaiting the `initialize` call itself
9
+ *
10
+ * For most APIs {@link ensureInitialized} is the right validation function to use instead.
11
+ *
12
+ * @internal
13
+ * Limited to Microsoft-internal use
14
+ */
15
+ export declare function ensureInitializeCalled(): void;
16
+ /**
17
+ * Ensures `initialize` was called and response from Host was received and processed and that `runtime` is initialized.
18
+ * If expected FrameContexts are provided, it also validates that the current FrameContext matches one of the expected ones.
19
+ *
20
+ * @internal
21
+ * Limited to Microsoft-internal use
22
+ */
23
+ export declare function ensureInitialized(runtime: IBaseRuntime, ...expectedFrameContexts: string[]): runtime is Runtime;
24
+ /**
25
+ * @hidden
26
+ * Checks whether the platform has knowledge of this API by doing a comparison
27
+ * on API required version and platform supported version of the SDK
28
+ *
29
+ * @param requiredVersion - SDK version required by the API
30
+ *
31
+ * @internal
32
+ * Limited to Microsoft-internal use
33
+ */
34
+ export declare function isCurrentSDKVersionAtLeast(requiredVersion?: string): boolean;
35
+ /**
36
+ * @hidden
37
+ * Helper function to identify if host client is either android, ios, or ipados
38
+ *
39
+ * @internal
40
+ * Limited to Microsoft-internal use
41
+ */
42
+ export declare function isHostClientMobile(): boolean;
43
+ /**
44
+ * @hidden
45
+ * Helper function which indicates if current API is supported on mobile or not.
46
+ * @throws SdkError if host client is not android/ios or if the requiredVersion is not
47
+ * supported by platform or not. Null is returned in case of success.
48
+ *
49
+ * @internal
50
+ * Limited to Microsoft-internal use
51
+ */
52
+ export declare function throwExceptionIfMobileApiIsNotSupported(requiredVersion?: string): void;
53
+ /**
54
+ * @hidden
55
+ * Processes the valid origins specifuied by the user, de-duplicates and converts them into a regexp
56
+ * which is used later for message source/origin validation
57
+ *
58
+ * @internal
59
+ * Limited to Microsoft-internal use
60
+ */
61
+ export declare function processAdditionalValidOrigins(validMessageOrigins: string[]): void;
@@ -0,0 +1,94 @@
1
+ import { marketplace } from '../public/marketplace';
2
+ /**
3
+ * @hidden
4
+ * deserialize the cart data:
5
+ * - convert url properties from string to URL
6
+ * @param cartItems The cart items
7
+ *
8
+ * @internal
9
+ * Limited to Microsoft-internal use
10
+ */
11
+ export declare function deserializeCart(cartData: any): marketplace.Cart;
12
+ /**
13
+ * @hidden
14
+ * deserialize the cart items:
15
+ * - convert url properties from string to URL
16
+ * @param cartItems The cart items
17
+ *
18
+ * @internal
19
+ * Limited to Microsoft-internal use
20
+ */
21
+ export declare function deserializeCartItems(cartItemsData: any): marketplace.CartItem;
22
+ /**
23
+ * @hidden
24
+ * serialize the cart items:
25
+ * - make URL properties to string
26
+ * @param cartItems The cart items
27
+ *
28
+ * @internal
29
+ * Limited to Microsoft-internal use
30
+ */
31
+ export declare const serializeCartItems: (cartItems: marketplace.CartItem[]) => any;
32
+ /**
33
+ * @hidden
34
+ * Validate the cart item properties are valid
35
+ * @param cartItems The cart items
36
+ *
37
+ * @internal
38
+ * Limited to Microsoft-internal use
39
+ */
40
+ export declare function validateCartItems(cartItems: marketplace.CartItem[]): void;
41
+ /**
42
+ * @hidden
43
+ * Validate accessories
44
+ * @param accessoryItems The accessories to be validated
45
+ *
46
+ * @internal
47
+ * Limited to Microsoft-internal use
48
+ */
49
+ export declare function validateAccessoryItems(accessoryItems: marketplace.Item[] | undefined | null): void;
50
+ /**
51
+ * @hidden
52
+ * Validate the basic cart item properties are valid
53
+ * @param basicCartItem The basic cart item
54
+ *
55
+ * @internal
56
+ * Limited to Microsoft-internal use
57
+ */
58
+ export declare function validateBasicCartItem(basicCartItem: marketplace.Item): void;
59
+ /**
60
+ * @hidden
61
+ * Validate the id is valid
62
+ * @param id A uuid string
63
+ *
64
+ * @internal
65
+ * Limited to Microsoft-internal use
66
+ */
67
+ export declare function validateUuid(id: string | undefined | null): void;
68
+ /**
69
+ * @hidden
70
+ * Validate the cart item properties are valid
71
+ * @param price The price to be validated
72
+ *
73
+ * @internal
74
+ * Limited to Microsoft-internal use
75
+ */
76
+ export declare function validatePrice(price: number): void;
77
+ /**
78
+ * @hidden
79
+ * Validate quantity
80
+ * @param quantity The quantity to be validated
81
+ *
82
+ * @internal
83
+ * Limited to Microsoft-internal use
84
+ */
85
+ export declare function validateQuantity(quantity: number): void;
86
+ /**
87
+ * @hidden
88
+ * Validate cart status
89
+ * @param cartStatus The cartStatus to be validated
90
+ *
91
+ * @internal
92
+ * Limited to Microsoft-internal use
93
+ */
94
+ export declare function validateCartStatus(cartStatus: marketplace.CartStatus): void;
@@ -0,0 +1,95 @@
1
+ import { media } from '../public/media';
2
+ import { people } from '../public/people';
3
+ /**
4
+ * @hidden
5
+ * Helper function to create a blob from media chunks based on their sequence
6
+ *
7
+ * @internal
8
+ * Limited to Microsoft-internal use
9
+ */
10
+ export declare function createFile(assembleAttachment: media.AssembleAttachment[], mimeType: string): Blob | null;
11
+ /**
12
+ * @hidden
13
+ * Helper function to convert Media chunks into another object type which can be later assemebled
14
+ * Converts base 64 encoded string to byte array and then into an array of blobs
15
+ *
16
+ * @internal
17
+ * Limited to Microsoft-internal use
18
+ */
19
+ export declare function decodeAttachment(attachment: media.MediaChunk, mimeType: string): media.AssembleAttachment | null;
20
+ /**
21
+ * @hidden
22
+ * Function throws an SdkError if the media call is not supported on current mobile version, else undefined.
23
+ *
24
+ * @throws an SdkError if the media call is not supported
25
+ *
26
+ * @internal
27
+ * Limited to Microsoft-internal use
28
+ */
29
+ export declare function throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs: media.MediaInputs): void;
30
+ /**
31
+ * @hidden
32
+ * Function returns true if the app has registered to listen to video controller events, else false.
33
+ *
34
+ * @internal
35
+ * Limited to Microsoft-internal use
36
+ */
37
+ export declare function isVideoControllerRegistered(mediaInputs: media.MediaInputs): boolean;
38
+ /**
39
+ * @hidden
40
+ * Returns true if the mediaInput params are valid and false otherwise
41
+ *
42
+ * @internal
43
+ * Limited to Microsoft-internal use
44
+ */
45
+ export declare function validateSelectMediaInputs(mediaInputs: media.MediaInputs): boolean;
46
+ /**
47
+ * @hidden
48
+ * Returns true if the mediaInput params are called for mediatype Image and contains Image outputs formats, false otherwise
49
+ *
50
+ * @internal
51
+ * Limited to Microsoft-internal use
52
+ */
53
+ export declare function isMediaCallForImageOutputFormats(mediaInputs: media.MediaInputs): boolean;
54
+ /**
55
+ * @hidden
56
+ * Returns true if the mediaInput params are called for mediatype VideoAndImage and false otherwise
57
+ *
58
+ * @internal
59
+ */
60
+ export declare function isMediaCallForVideoAndImageInputs(mediaInputs: media.MediaInputs): boolean;
61
+ /**
62
+ * @hidden
63
+ * Returns true if the mediaInput params are called for non-full screen video mode and false otherwise
64
+ *
65
+ * @internal
66
+ */
67
+ export declare function isMediaCallForNonFullScreenVideoMode(mediaInputs: media.MediaInputs): boolean;
68
+ /**
69
+ * @hidden
70
+ * Returns true if the get Media params are valid and false otherwise
71
+ *
72
+ * @internal
73
+ */
74
+ export declare function validateGetMediaInputs(mimeType: string, format: media.FileFormat, content: string): boolean;
75
+ /**
76
+ * @hidden
77
+ * Returns true if the view images param is valid and false otherwise
78
+ *
79
+ * @internal
80
+ */
81
+ export declare function validateViewImagesInput(uriList: media.ImageUri[]): boolean;
82
+ /**
83
+ * @hidden
84
+ * Returns true if the scan barcode param is valid and false otherwise
85
+ *
86
+ * @internal
87
+ */
88
+ export declare function validateScanBarCodeInput(barCodeConfig?: media.BarCodeConfig): boolean;
89
+ /**
90
+ * @hidden
91
+ * Returns true if the people picker params are valid and false otherwise
92
+ *
93
+ * @internal
94
+ */
95
+ export declare function validatePeoplePickerInput(peoplePickerInputs?: people.PeoplePickerInputs): boolean;
@@ -0,0 +1,73 @@
1
+ import { UUID as MessageUUID } from './uuidObject';
2
+ /**
3
+ * @internal
4
+ * Limited to Microsoft-internal use
5
+ *
6
+ * MessageIDs represent the legacy number id used for processing MessageRequests and MessageResponses
7
+ */
8
+ export type MessageID = number;
9
+ /**
10
+ * @internal
11
+ * Limited to Microsoft-internal use
12
+ */
13
+ export interface MessageRequest {
14
+ id?: MessageID;
15
+ uuid?: MessageUUID;
16
+ func: string;
17
+ timestamp?: number;
18
+ args?: any[];
19
+ apiVersionTag?: string;
20
+ isPartialResponse?: boolean;
21
+ }
22
+ /**
23
+ * @internal
24
+ * Limited to Microsoft-internal use
25
+ */
26
+ export interface SerializedMessageRequest {
27
+ id?: MessageID;
28
+ uuidAsString?: string;
29
+ func: string;
30
+ timestamp?: number;
31
+ args?: any[];
32
+ apiVersionTag?: string;
33
+ }
34
+ /**
35
+ * @internal
36
+ * Limited to Microsoft-internal use
37
+ */
38
+ export interface SerializedMessageResponse {
39
+ id: MessageID;
40
+ uuidAsString?: string;
41
+ args?: any[];
42
+ isPartialResponse?: boolean;
43
+ }
44
+ /**
45
+ * @internal
46
+ * Limited to Microsoft-internal use
47
+ */
48
+ export interface MessageResponse {
49
+ id: MessageID;
50
+ uuid?: MessageUUID;
51
+ args?: any[];
52
+ isPartialResponse?: boolean;
53
+ }
54
+ /**
55
+ * @internal
56
+ * Limited to Microsoft-internal use
57
+ *
58
+ * For reasons that are unclear at this time, some MessageRequest objects can exist without an id or timestamp, even though
59
+ * many parts of code assume that they are defined.
60
+ * To enable type-safety in some scenarios, this new interface can be used where these properties are required. Because it
61
+ * derives from the original interface, objects of this type can be user interchangeably with the original interface.
62
+ * As the required messaging scenarios are better understood, the interfaces will eventually be updated and
63
+ * merged. However, it's a journey.
64
+ */
65
+ export interface MessageRequestWithRequiredProperties extends MessageRequest {
66
+ id: MessageID;
67
+ uuid: MessageUUID;
68
+ timestamp: number;
69
+ }
70
+ export declare const serializeMessageRequest: (message: MessageRequest) => SerializedMessageRequest;
71
+ export declare const deserializeMessageRequest: (message: SerializedMessageRequest) => MessageRequest;
72
+ export declare const deserializeMessageResponse: (serializedResponse: SerializedMessageResponse) => MessageResponse;
73
+ export declare const serializeMessageResponse: (response: MessageResponse) => SerializedMessageResponse;
@@ -0,0 +1,105 @@
1
+ import { MessageRequestWithRequiredProperties } from './messageObjects';
2
+ /**
3
+ * @hidden
4
+ * Enumeration for nested app authentication message event names.
5
+ *
6
+ * @internal
7
+ * Limited to Microsoft-internal use
8
+ *
9
+ * @enum {string}
10
+ *
11
+ * @property {string} Request - Event name for a nested app authentication request.
12
+ * @property {string} Response - Event name for a nested app authentication response.
13
+ */
14
+ export declare const enum NestedAppAuthMessageEventNames {
15
+ Request = "NestedAppAuthRequest",
16
+ Response = "NestedAppAuthResponse"
17
+ }
18
+ /**
19
+ * @hidden
20
+ * Interface for a nested app authentication request.
21
+ *
22
+ * @internal
23
+ * Limited to Microsoft-internal use
24
+ *
25
+ * @interface
26
+ * @extends {MessageRequest}
27
+ *
28
+ * @property {string} func - The function name, should always be 'nestedAppAuthRequest'.
29
+ * @property {string} data - data associated with the request, represented as a string.
30
+ */
31
+ export interface NestedAppAuthRequest extends MessageRequestWithRequiredProperties {
32
+ func: 'nestedAppAuth.execute';
33
+ data: string;
34
+ }
35
+ /**
36
+ * @hidden
37
+ * Interface for parsed data from a nested app authentication message.
38
+ *
39
+ * @internal
40
+ * Limited to Microsoft-internal use
41
+ *
42
+ * @interface
43
+ * @property {NestedAppAuthMessageEventNames} messageType - The type of the nested app authentication message event.
44
+ */
45
+ export interface ParsedNestedAppAuthMessageData {
46
+ messageType: NestedAppAuthMessageEventNames;
47
+ }
48
+ /**
49
+ * @hidden
50
+ * Interface for a nested app authentication bridge.
51
+ *
52
+ * @internal
53
+ * Limited to Microsoft-internal use
54
+ *
55
+ * @interface
56
+ *
57
+ * @property {Function} addEventListener - Function to add an event listener to the bridge. Takes an event name and a callback function as parameters.
58
+ * @property {Function} postMessage - Function to post a message to the bridge. Takes a message string as a parameter.
59
+ * @property {Function} removeEventListener - Function to remove an event listener from the bridge. Takes an event name and a callback function as parameters.
60
+ */
61
+ export interface NestedAppAuthBridge {
62
+ addEventListener: (eventName: string, callback: (response: string) => void) => void;
63
+ postMessage: (message: string) => void;
64
+ removeEventListener: (eventName: string, callback: (response: string) => void) => void;
65
+ }
66
+ /**
67
+ * @hidden
68
+ * Interface for a Window object extended with a nested app authentication bridge.
69
+ *
70
+ * @internal
71
+ * Limited to Microsoft-internal use
72
+ *
73
+ * @interface
74
+ * @extends {Window}
75
+ *
76
+ * @property {NestedAppAuthBridge} nestedAppAuthBridge - The nested app authentication bridge associated with the window.
77
+ */
78
+ export interface NestedAuthExtendedWindow extends Window {
79
+ nestedAppAuthBridge: NestedAppAuthBridge;
80
+ }
81
+ /**
82
+ * @hidden
83
+ * Type for handlers in a nested app authentication bridge.
84
+ *
85
+ * @internal
86
+ * Limited to Microsoft-internal use
87
+ *
88
+ * @typedef {Object} NestedAppAuthBridgeHandlers
89
+ *
90
+ * @property {Function} onMessage - Function to handle a message event. Takes a MessageEvent object and a callback function as parameters. The callback function is called when a message is received.
91
+ * @property {Function} handlePostMessage - Function to handle posting a message. Takes a message string as a parameter.
92
+ */
93
+ type NestedAppAuthBridgeHandlers = {
94
+ onMessage: (evt: MessageEvent, onMessageReceived: (response: string) => void) => void;
95
+ sendPostMessage: (message: string) => void;
96
+ };
97
+ /**
98
+ * @hidden
99
+ * Attempt to polyfill the nestedAppAuthBridge object on the given window
100
+ *
101
+ * @internal
102
+ * Limited to Microsoft-internal use
103
+ */
104
+ export declare function tryPolyfillWithNestedAppAuthBridge(clientSupportedSDKVersion: string, window: Window | null, handlers: NestedAppAuthBridgeHandlers): void;
105
+ export {};
@@ -0,0 +1,11 @@
1
+ import { profile } from '../public/profile';
2
+ /**
3
+ * @hidden
4
+ * Validates the request parameters
5
+ * @param showProfileRequest The request parameters
6
+ * @returns true if the parameters are valid, false otherwise
7
+ *
8
+ * @internal
9
+ * Limited to Microsoft-internal use
10
+ */
11
+ export declare function validateShowProfileRequest(showProfileRequest: profile.ShowProfileRequest): [boolean, string | undefined];
@@ -0,0 +1,30 @@
1
+ /**
2
+ * This class is used for validating and deserializing the response from the host.
3
+ *
4
+ * @typeParam SerializedReturnValueFromHost The type of the response received from the host
5
+ * @typeParam DeserializedReturnValueFromHost The type of the response after deserialization
6
+ */
7
+ export declare abstract class ResponseHandler<SerializedReturnValueFromHost, DeserializedReturnValueFromHost> {
8
+ /**
9
+ * Checks if the response from the host is valid.
10
+ *
11
+ * @param response The response from the host to validate
12
+ *
13
+ * @returns True if the response is valid, false otherwise
14
+ */
15
+ abstract validate(response: SerializedReturnValueFromHost): boolean;
16
+ /**
17
+ * This function converts the response from the host into a different format
18
+ * before returning it to the caller (if needed).
19
+ * @param response
20
+ */
21
+ abstract deserialize(response: SerializedReturnValueFromHost): DeserializedReturnValueFromHost;
22
+ }
23
+ export type SimpleType = string | number | boolean | null | undefined | SimpleType[];
24
+ /**
25
+ * This class is used for validating and deserializing boolean responses from the host.
26
+ */
27
+ export declare class SimpleTypeResponseHandler<T extends SimpleType> extends ResponseHandler<T, T> {
28
+ validate(_response: T): boolean;
29
+ deserialize(response: T): T;
30
+ }