@microsoft/teams-js 2.30.0-beta.0 → 2.31.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/dist/esm/_virtual/__polyfill-node.os.js +1 -0
- package/dist/esm/_virtual/_polyfill-node.os.js +1 -0
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/node.js +1 -1
- package/dist/esm/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +1 -0
- package/dist/esm/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +1 -0
- package/dist/esm/packages/teams-js/dts/index.d.ts +2 -0
- package/dist/esm/packages/teams-js/dts/internal/VideoFrameTypes.d.ts +78 -0
- package/dist/esm/packages/teams-js/dts/internal/appHelpers.d.ts +8 -0
- package/dist/esm/packages/teams-js/dts/internal/appIdValidation.d.ts +16 -0
- package/dist/esm/packages/teams-js/dts/internal/communication.d.ts +162 -0
- package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +146 -0
- package/dist/esm/packages/teams-js/dts/internal/deepLinkConstants.d.ts +26 -0
- package/dist/esm/packages/teams-js/dts/internal/deepLinkUtilities.d.ts +4 -0
- package/dist/esm/packages/teams-js/dts/internal/emailAddressValidation.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/internal/globalVars.d.ts +12 -0
- package/dist/esm/packages/teams-js/dts/internal/handlers.d.ts +80 -0
- package/dist/esm/packages/teams-js/dts/internal/interfaces.d.ts +47 -0
- package/dist/esm/packages/teams-js/dts/internal/internalAPIs.d.ts +61 -0
- package/dist/esm/packages/teams-js/dts/internal/marketplaceUtils.d.ts +94 -0
- package/dist/esm/packages/teams-js/dts/internal/mediaUtil.d.ts +95 -0
- package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +73 -0
- package/dist/esm/packages/teams-js/dts/internal/nestedAppAuthUtils.d.ts +105 -0
- package/dist/esm/packages/teams-js/dts/internal/profileUtil.d.ts +11 -0
- package/dist/esm/packages/teams-js/dts/internal/responseHandler.d.ts +30 -0
- package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +344 -0
- package/dist/esm/packages/teams-js/dts/internal/typeCheckUtilities.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/internal/utils.d.ts +200 -0
- package/dist/esm/packages/teams-js/dts/internal/uuidObject.d.ts +11 -0
- package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +6 -0
- package/dist/esm/packages/teams-js/dts/internal/videoEffectsUtils.d.ts +31 -0
- package/dist/esm/packages/teams-js/dts/internal/videoFrameTick.d.ts +10 -0
- package/dist/esm/packages/teams-js/dts/internal/videoPerformanceMonitor.d.ts +54 -0
- package/dist/esm/packages/teams-js/dts/internal/videoPerformanceStatistics.d.ts +49 -0
- package/dist/esm/packages/teams-js/dts/private/appEntity.d.ts +89 -0
- package/dist/esm/packages/teams-js/dts/private/constants.d.ts +9 -0
- package/dist/esm/packages/teams-js/dts/private/conversations.d.ts +152 -0
- package/dist/esm/packages/teams-js/dts/private/copilot.d.ts +39 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthentication.d.ts +378 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppAuthenticationForCEA.d.ts +75 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppCardActions.d.ts +112 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppCardActionsForCEA.d.ts +49 -0
- package/dist/esm/packages/teams-js/dts/private/externalAppCommands.d.ts +123 -0
- package/dist/esm/packages/teams-js/dts/private/files.d.ts +758 -0
- package/dist/esm/packages/teams-js/dts/private/hostEntity.d.ts +176 -0
- package/dist/esm/packages/teams-js/dts/private/index.d.ts +20 -0
- package/dist/esm/packages/teams-js/dts/private/interfaces.d.ts +250 -0
- package/dist/esm/packages/teams-js/dts/private/logs.d.ts +25 -0
- package/dist/esm/packages/teams-js/dts/private/meetingRoom.d.ts +203 -0
- package/dist/esm/packages/teams-js/dts/private/messageChannels.d.ts +107 -0
- package/dist/esm/packages/teams-js/dts/private/notifications.d.ts +26 -0
- package/dist/esm/packages/teams-js/dts/private/otherAppStateChange.d.ts +81 -0
- package/dist/esm/packages/teams-js/dts/private/privateAPIs.d.ts +60 -0
- package/dist/esm/packages/teams-js/dts/private/remoteCamera.d.ts +298 -0
- package/dist/esm/packages/teams-js/dts/private/teams.d.ts +116 -0
- package/dist/esm/packages/teams-js/dts/private/videoEffectsEx.d.ts +244 -0
- package/dist/esm/packages/teams-js/dts/public/adaptiveCards.d.ts +6 -0
- package/dist/esm/packages/teams-js/dts/public/app.d.ts +592 -0
- package/dist/esm/packages/teams-js/dts/public/appId.d.ts +33 -0
- package/dist/esm/packages/teams-js/dts/public/appInitialization.d.ts +57 -0
- package/dist/esm/packages/teams-js/dts/public/appInstallDialog.d.ts +18 -0
- package/dist/esm/packages/teams-js/dts/public/appWindow.d.ts +66 -0
- package/dist/esm/packages/teams-js/dts/public/authentication.d.ts +409 -0
- package/dist/esm/packages/teams-js/dts/public/barCode.d.ts +53 -0
- package/dist/esm/packages/teams-js/dts/public/calendar.d.ts +40 -0
- package/dist/esm/packages/teams-js/dts/public/call.d.ts +53 -0
- package/dist/esm/packages/teams-js/dts/public/chat.d.ts +66 -0
- package/dist/esm/packages/teams-js/dts/public/clipboard.d.ts +34 -0
- package/dist/esm/packages/teams-js/dts/public/constants.d.ts +179 -0
- package/dist/esm/packages/teams-js/dts/public/dialog.d.ts +286 -0
- package/dist/esm/packages/teams-js/dts/public/emailAddress.d.ts +12 -0
- package/dist/esm/packages/teams-js/dts/public/geoLocation.d.ts +100 -0
- package/dist/esm/packages/teams-js/dts/public/index.d.ts +44 -0
- package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +1133 -0
- package/dist/esm/packages/teams-js/dts/public/liveShareHost.d.ts +221 -0
- package/dist/esm/packages/teams-js/dts/public/location.d.ts +86 -0
- package/dist/esm/packages/teams-js/dts/public/mail.d.ts +95 -0
- package/dist/esm/packages/teams-js/dts/public/marketplace.d.ts +321 -0
- package/dist/esm/packages/teams-js/dts/public/media.d.ts +440 -0
- package/dist/esm/packages/teams-js/dts/public/meeting.d.ts +906 -0
- package/dist/esm/packages/teams-js/dts/public/menus.d.ts +188 -0
- package/dist/esm/packages/teams-js/dts/public/monetization.d.ts +58 -0
- package/dist/esm/packages/teams-js/dts/public/navigation.d.ts +45 -0
- package/dist/esm/packages/teams-js/dts/public/nestedAppAuth.d.ts +15 -0
- package/dist/esm/packages/teams-js/dts/public/pages.d.ts +574 -0
- package/dist/esm/packages/teams-js/dts/public/people.d.ts +75 -0
- package/dist/esm/packages/teams-js/dts/public/profile.d.ts +127 -0
- package/dist/esm/packages/teams-js/dts/public/publicAPIs.d.ts +218 -0
- package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +207 -0
- package/dist/esm/packages/teams-js/dts/public/search.d.ts +91 -0
- package/dist/esm/packages/teams-js/dts/public/secondaryBrowser.d.ts +32 -0
- package/dist/esm/packages/teams-js/dts/public/serializable.interface.d.ts +17 -0
- package/dist/esm/packages/teams-js/dts/public/settings.d.ts +101 -0
- package/dist/esm/packages/teams-js/dts/public/sharing.d.ts +124 -0
- package/dist/esm/packages/teams-js/dts/public/stageView.d.ts +104 -0
- package/dist/esm/packages/teams-js/dts/public/tasks.d.ts +62 -0
- package/dist/esm/packages/teams-js/dts/public/teamsAPIs.d.ts +77 -0
- package/dist/esm/packages/teams-js/dts/public/thirdPartyCloudStorage.d.ts +119 -0
- package/dist/esm/packages/teams-js/dts/public/version.d.ts +5 -0
- package/dist/esm/packages/teams-js/dts/public/videoEffects.d.ts +213 -0
- package/dist/esm/packages/teams-js/dts/public/visualMedia.d.ts +192 -0
- package/dist/esm/packages/teams-js/dts/public/webStorage.d.ts +27 -0
- package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -1
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/responseHandler.js +1 -0
- package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/hostEntity.js +1 -1
- package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
- package/dist/esm/packages/teams-js/src/public/app.js +1 -1
- package/dist/esm/packages/teams-js/src/public/appId.js +1 -1
- package/dist/esm/packages/teams-js/src/public/appInitialization.js +1 -1
- package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
- package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
- package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
- package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
- package/dist/esm/packages/teams-js/src/public/call.js +1 -1
- package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
- package/dist/esm/packages/teams-js/src/public/constants.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages.js +1 -1
- package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/serializable.interface.js +1 -0
- package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
- package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
- package/dist/umd/MicrosoftTeams.d.ts +10740 -10768
- package/dist/umd/MicrosoftTeams.js +1572 -1360
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/browser.js +0 -1
@@ -0,0 +1,213 @@
|
|
1
|
+
/**
|
2
|
+
* Namespace to video extensibility of the SDK
|
3
|
+
* @beta
|
4
|
+
*/
|
5
|
+
export declare namespace videoEffects {
|
6
|
+
/** Notify video frame processed function type */
|
7
|
+
type notifyVideoFrameProcessedFunctionType = () => void;
|
8
|
+
/** Notify error function type */
|
9
|
+
type notifyErrorFunctionType = (errorMessage: string) => void;
|
10
|
+
/**
|
11
|
+
* Represents a video frame
|
12
|
+
* @beta
|
13
|
+
*/
|
14
|
+
interface VideoBufferData {
|
15
|
+
/**
|
16
|
+
* Video frame width
|
17
|
+
*/
|
18
|
+
width: number;
|
19
|
+
/**
|
20
|
+
* Video frame height
|
21
|
+
*/
|
22
|
+
height: number;
|
23
|
+
/**
|
24
|
+
* Video frame buffer
|
25
|
+
*/
|
26
|
+
videoFrameBuffer: Uint8ClampedArray;
|
27
|
+
/**
|
28
|
+
* NV12 luma stride, valid only when video frame format is NV12
|
29
|
+
*/
|
30
|
+
lumaStride?: number;
|
31
|
+
/**
|
32
|
+
* NV12 chroma stride, valid only when video frame format is NV12
|
33
|
+
*/
|
34
|
+
chromaStride?: number;
|
35
|
+
/**
|
36
|
+
* RGB stride, valid only when video frame format is RGB
|
37
|
+
*/
|
38
|
+
stride?: number;
|
39
|
+
/**
|
40
|
+
* The time stamp of the current video frame
|
41
|
+
*/
|
42
|
+
timestamp?: number;
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* Video frame format enum, currently only support NV12
|
46
|
+
* @beta
|
47
|
+
*/
|
48
|
+
enum VideoFrameFormat {
|
49
|
+
/** Video format used for encoding and decoding YUV color data in video streaming and storage applications. */
|
50
|
+
NV12 = "NV12"
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* Video frame configuration supplied to the host to customize the generated video frame parameters, like format
|
54
|
+
* @beta
|
55
|
+
*/
|
56
|
+
interface VideoFrameConfig {
|
57
|
+
/**
|
58
|
+
* Video format
|
59
|
+
*/
|
60
|
+
format: VideoFrameFormat;
|
61
|
+
}
|
62
|
+
/**
|
63
|
+
* Video effect change type enum
|
64
|
+
* @beta
|
65
|
+
*/
|
66
|
+
enum EffectChangeType {
|
67
|
+
/**
|
68
|
+
* Current video effect changed
|
69
|
+
*/
|
70
|
+
EffectChanged = "EffectChanged",
|
71
|
+
/**
|
72
|
+
* Disable the video effect
|
73
|
+
*/
|
74
|
+
EffectDisabled = "EffectDisabled"
|
75
|
+
}
|
76
|
+
/**
|
77
|
+
* Predefined failure reasons for preparing the selected video effect
|
78
|
+
* @beta
|
79
|
+
*/
|
80
|
+
enum EffectFailureReason {
|
81
|
+
/**
|
82
|
+
* A wrong effect id is provide.
|
83
|
+
* Use this reason when the effect id is not found or empty, this may indicate a mismatch between the app and its manifest or a bug of the host.
|
84
|
+
*/
|
85
|
+
InvalidEffectId = "InvalidEffectId",
|
86
|
+
/**
|
87
|
+
* The effect can't be initialized
|
88
|
+
*/
|
89
|
+
InitializationFailure = "InitializationFailure"
|
90
|
+
}
|
91
|
+
/**
|
92
|
+
* Video effect change call back function definition
|
93
|
+
* Return a Promise which will be resolved when the effect is prepared, or throw an {@link EffectFailureReason} on error.
|
94
|
+
* @beta
|
95
|
+
*/
|
96
|
+
type VideoEffectCallback = (effectId: string | undefined) => Promise<void>;
|
97
|
+
/**
|
98
|
+
* @beta
|
99
|
+
* Video frame call back function definition
|
100
|
+
* The callback will be called on every frame when running on the supported host.
|
101
|
+
* We require the frame rate of the video to be at least 22fps for 720p, thus the callback should process a frame timely.
|
102
|
+
* The video app should call `notifyVideoFrameProcessed` to notify a successfully processed video frame.
|
103
|
+
* The video app should call `notifyError` to notify a failure. When the failures accumulate to a certain number, the host will see the app is "frozen" and ask the user to close it or not.
|
104
|
+
*/
|
105
|
+
type VideoBufferHandler = (videoBufferData: VideoBufferData, notifyVideoFrameProcessed: notifyVideoFrameProcessedFunctionType, notifyError: notifyErrorFunctionType) => void;
|
106
|
+
/**
|
107
|
+
* @beta
|
108
|
+
* VideoFrame definition, align with the W3C spec: https://www.w3.org/TR/webcodecs/#videoframe-interface.
|
109
|
+
* The current version of typescript doesn't have the definition of VideoFrame so we have to define it here.
|
110
|
+
* At runtime it can be cast to VideoFrame directly: `(videoFrame as VideoFrame)`.
|
111
|
+
*/
|
112
|
+
interface VideoFrame {
|
113
|
+
}
|
114
|
+
/**
|
115
|
+
* @beta
|
116
|
+
* Video frame data extracted from the media stream. More properties may be added in the future.
|
117
|
+
*/
|
118
|
+
type VideoFrameData = {
|
119
|
+
/**
|
120
|
+
* The video frame from the media stream.
|
121
|
+
*/
|
122
|
+
videoFrame: VideoFrame;
|
123
|
+
};
|
124
|
+
/**
|
125
|
+
* @beta
|
126
|
+
* Video frame call back function definition.
|
127
|
+
* The callback will be called on every frame when running on the supported host.
|
128
|
+
* We require the frame rate of the video to be at least 22fps for 720p, thus the callback should process a frame timely.
|
129
|
+
* The video app should resolve the promise to notify a successfully processed video frame.
|
130
|
+
* The video app should reject the promise to notify a failure. When the failures accumulate to a certain number, the host will see the app is "frozen" and ask the user to close it or not.
|
131
|
+
*/
|
132
|
+
type VideoFrameHandler = (receivedVideoFrame: VideoFrameData) => Promise<VideoFrame>;
|
133
|
+
/**
|
134
|
+
* @beta
|
135
|
+
* Callbacks and configuration supplied to the host to process the video frames.
|
136
|
+
*/
|
137
|
+
type RegisterForVideoFrameParameters = {
|
138
|
+
/**
|
139
|
+
* Callback function to process the video frames extracted from a media stream.
|
140
|
+
*/
|
141
|
+
videoFrameHandler: VideoFrameHandler;
|
142
|
+
/**
|
143
|
+
* Callback function to process the video frames shared by the host.
|
144
|
+
*/
|
145
|
+
videoBufferHandler: VideoBufferHandler;
|
146
|
+
/**
|
147
|
+
* Video frame configuration supplied to the host to customize the generated video frame parameters, like format
|
148
|
+
*/
|
149
|
+
config: VideoFrameConfig;
|
150
|
+
};
|
151
|
+
/**
|
152
|
+
* Register callbacks to process the video frames if the host supports it.
|
153
|
+
* @beta
|
154
|
+
* @param parameters - Callbacks and configuration to process the video frames. A host may support either {@link VideoFrameHandler} or {@link VideoBufferHandler}, but not both.
|
155
|
+
* To ensure the video effect works on all supported hosts, the video app must provide both {@link VideoFrameHandler} and {@link VideoBufferHandler}.
|
156
|
+
* The host will choose the appropriate callback based on the host's capability.
|
157
|
+
*
|
158
|
+
* @example
|
159
|
+
* ```typescript
|
160
|
+
* videoEffects.registerForVideoFrame({
|
161
|
+
* videoFrameHandler: async (videoFrameData) => {
|
162
|
+
* const originalFrame = videoFrameData.videoFrame as VideoFrame;
|
163
|
+
* try {
|
164
|
+
* const processedFrame = await processFrame(originalFrame);
|
165
|
+
* return processedFrame;
|
166
|
+
* } catch (e) {
|
167
|
+
* throw e;
|
168
|
+
* }
|
169
|
+
* },
|
170
|
+
* videoBufferHandler: (
|
171
|
+
* bufferData: VideoBufferData,
|
172
|
+
* notifyVideoFrameProcessed: notifyVideoFrameProcessedFunctionType,
|
173
|
+
* notifyError: notifyErrorFunctionType
|
174
|
+
* ) => {
|
175
|
+
* try {
|
176
|
+
* processFrameInplace(bufferData);
|
177
|
+
* notifyVideoFrameProcessed();
|
178
|
+
* } catch (e) {
|
179
|
+
* notifyError(e);
|
180
|
+
* }
|
181
|
+
* },
|
182
|
+
* config: {
|
183
|
+
* format: videoEffects.VideoPixelFormat.NV12,
|
184
|
+
* }
|
185
|
+
* });
|
186
|
+
* ```
|
187
|
+
*/
|
188
|
+
function registerForVideoFrame(parameters: RegisterForVideoFrameParameters): void;
|
189
|
+
/**
|
190
|
+
* Video extension should call this to notify host that the current selected effect parameter changed.
|
191
|
+
* If it's pre-meeting, host will call videoEffectCallback immediately then use the videoEffect.
|
192
|
+
* If it's the in-meeting scenario, we will call videoEffectCallback when apply button clicked.
|
193
|
+
* @beta
|
194
|
+
* @param effectChangeType - the effect change type.
|
195
|
+
* @param effectId - Newly selected effect id.
|
196
|
+
*/
|
197
|
+
function notifySelectedVideoEffectChanged(effectChangeType: EffectChangeType, effectId: string | undefined): void;
|
198
|
+
/**
|
199
|
+
* Register a callback to be notified when a new video effect is applied.
|
200
|
+
* @beta
|
201
|
+
* @param callback - Function to be called when new video effect is applied.
|
202
|
+
*/
|
203
|
+
function registerForVideoEffect(callback: VideoEffectCallback): void;
|
204
|
+
/**
|
205
|
+
* Checks if video capability is supported by the host.
|
206
|
+
* @beta
|
207
|
+
* @returns boolean to represent whether the video capability is supported
|
208
|
+
*
|
209
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
210
|
+
*
|
211
|
+
*/
|
212
|
+
function isSupported(): boolean;
|
213
|
+
}
|
@@ -0,0 +1,192 @@
|
|
1
|
+
/**
|
2
|
+
* @hidden
|
3
|
+
* Interact with images. Allows the app developer ask the user to get images from their camera / camera roll / file system.
|
4
|
+
*
|
5
|
+
* @beta
|
6
|
+
*/
|
7
|
+
export declare namespace visualMedia {
|
8
|
+
/**
|
9
|
+
* @hidden
|
10
|
+
* All properties common to Image and Video Props
|
11
|
+
*
|
12
|
+
* @beta
|
13
|
+
*/
|
14
|
+
interface VisualMediaProps {
|
15
|
+
/**
|
16
|
+
* @hidden
|
17
|
+
* The maximum number of media items that can be selected at once is limited to values that are less than or equal to the maximum visual media selection limit.
|
18
|
+
*/
|
19
|
+
maxVisualMediaCount: number;
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* @hidden
|
23
|
+
* The required value of the visualMedia files from gallery
|
24
|
+
*
|
25
|
+
* @beta
|
26
|
+
*/
|
27
|
+
export interface GalleryProps {
|
28
|
+
/**
|
29
|
+
* The visualMedia source
|
30
|
+
*/
|
31
|
+
source: Source.Gallery;
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* @hidden
|
35
|
+
* The required value of the visualMedia files from camera
|
36
|
+
*
|
37
|
+
* @beta
|
38
|
+
*/
|
39
|
+
export interface CameraProps {
|
40
|
+
/**
|
41
|
+
* @hidden
|
42
|
+
* The visualMedia source
|
43
|
+
*/
|
44
|
+
source: Source.Camera;
|
45
|
+
/**
|
46
|
+
* @hidden
|
47
|
+
* Optional; Specify whether users have the option to switch between the front and rear cameras. The default setting is FrontOrRear.
|
48
|
+
* Default value is FrontOrRear
|
49
|
+
*/
|
50
|
+
cameraRestriction?: CameraRestriction;
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* @hidden
|
54
|
+
* Indicate if user is allowed to move between front and back camera or stay in front/back camera only
|
55
|
+
* If the camera option requested by the app isn't available, the SDK will silently default to the platform's standard camera.
|
56
|
+
*
|
57
|
+
* @beta
|
58
|
+
*/
|
59
|
+
export enum CameraRestriction {
|
60
|
+
/** User can move between front and back camera */
|
61
|
+
FrontOrRear = 1,
|
62
|
+
/** User can only use the front camera */
|
63
|
+
FrontOnly = 2,
|
64
|
+
/** User can only use the back camera */
|
65
|
+
RearOnly = 3
|
66
|
+
}
|
67
|
+
/**
|
68
|
+
* @hidden
|
69
|
+
* Specifies the image source
|
70
|
+
*
|
71
|
+
* @beta
|
72
|
+
*/
|
73
|
+
export enum Source {
|
74
|
+
/** The camera is the source of visual media. */
|
75
|
+
Camera = 1,
|
76
|
+
/** The source of visual media is the gallery. */
|
77
|
+
Gallery = 2
|
78
|
+
}
|
79
|
+
/**
|
80
|
+
* @hidden
|
81
|
+
* VisualMediaFile object that can be used to represent image or video from host apps.
|
82
|
+
*
|
83
|
+
* @beta
|
84
|
+
*/
|
85
|
+
export interface VisualMediaFile {
|
86
|
+
/**
|
87
|
+
* @hidden
|
88
|
+
* This is the base64 content of file.
|
89
|
+
* If app needs to use this directly in HTML tags, it should convert this to a data url.
|
90
|
+
*/
|
91
|
+
content: string;
|
92
|
+
/**
|
93
|
+
* @hidden
|
94
|
+
* The size of file represented in VisualMediaFile in KB
|
95
|
+
*/
|
96
|
+
sizeInKB: number;
|
97
|
+
/**
|
98
|
+
* @hidden
|
99
|
+
* Name of the file (does not include the extension)
|
100
|
+
*/
|
101
|
+
name: string;
|
102
|
+
/**
|
103
|
+
* @hidden
|
104
|
+
* File's MIME type. More information on supported `mimeTypes`(https://docs.lens.xyz/docs/metadata-standards#supported-mime-types-for-imagesaudiovideos).
|
105
|
+
*/
|
106
|
+
mimeType: string;
|
107
|
+
}
|
108
|
+
/**
|
109
|
+
* @hidden
|
110
|
+
* Checks whether or not visualMedia has user permission
|
111
|
+
* @returns Promise that will resolve with true if the user had granted the app permission to media information(including Camera and Gallery permission), or with false otherwise,
|
112
|
+
* In case of an error, promise will reject with the error.
|
113
|
+
* @throws NOT_SUPPORTED_ON_PLATFORM Error if the DevicePermission.Media permission has not successfully granted.
|
114
|
+
*
|
115
|
+
* @beta
|
116
|
+
*/
|
117
|
+
export function hasPermission(): Promise<boolean>;
|
118
|
+
/**
|
119
|
+
* @hidden
|
120
|
+
* Requests user permission for visualMedia
|
121
|
+
* @returns Promise that will resolve with true if the user consented permission for media(including Camera and Gallery permission), or with false otherwise,
|
122
|
+
* In case of an error, promise will reject with the error.
|
123
|
+
* @throws NOT_SUPPORTED_ON_PLATFORM Error if the DevicePermission.Media permission has not successfully granted.
|
124
|
+
*
|
125
|
+
* @beta
|
126
|
+
*/
|
127
|
+
export function requestPermission(): Promise<boolean>;
|
128
|
+
/**
|
129
|
+
* @hidden
|
130
|
+
* To enable this image capability will let the app developer ask the user to get images from camera/local storage
|
131
|
+
*
|
132
|
+
* @beta
|
133
|
+
*/
|
134
|
+
export namespace image {
|
135
|
+
/**
|
136
|
+
* @hidden
|
137
|
+
* CameraImageProperties is for the image taken from the camera
|
138
|
+
*
|
139
|
+
* @beta
|
140
|
+
*/
|
141
|
+
interface CameraImageProperties extends VisualMediaProps {
|
142
|
+
/**
|
143
|
+
* @hidden
|
144
|
+
* The source in CameraImageProperties should always be CameraProps
|
145
|
+
*/
|
146
|
+
sourceProps: CameraProps;
|
147
|
+
}
|
148
|
+
/**
|
149
|
+
* @hidden
|
150
|
+
* CameraImageProperties is for the image taken from the camera
|
151
|
+
*
|
152
|
+
* @beta
|
153
|
+
*/
|
154
|
+
interface GalleryImageProperties extends VisualMediaProps {
|
155
|
+
/**
|
156
|
+
* @hidden
|
157
|
+
* The source in GalleryImageProperties should always be GalleryProps
|
158
|
+
*/
|
159
|
+
sourceProps: GalleryProps;
|
160
|
+
}
|
161
|
+
/**
|
162
|
+
* @hidden
|
163
|
+
* Capture one or multiple image(s) using camera.
|
164
|
+
* @param cameraImageInputs - The input params to customize the image(s) to be captured
|
165
|
+
* @returns Promise that will resolve with {@link VisualMediaFile[]} object or reject with an error.
|
166
|
+
* @throws INVALID_ARGUMENTS Error if imageInputs is null or imageInputs.maxVisualMediaCount is greater than maxVisualMediaSelectionLimit or lesser than 1.
|
167
|
+
*
|
168
|
+
* @beta
|
169
|
+
*/
|
170
|
+
function captureImages(cameraImageInputs: CameraImageProperties): Promise<VisualMediaFile[]>;
|
171
|
+
/**
|
172
|
+
* @hidden
|
173
|
+
* Upload the existing image(s) from the gallery.
|
174
|
+
* @param galleryImageInputs - The input params to customize the image(s) to be captured
|
175
|
+
* @returns Promise that will resolve with {@link VisualMediaFile[]} object or reject with an error.
|
176
|
+
* @throws INVALID_ARGUMENTS Error if imageInputs is null or imageInputs.maxVisualMediaCount is greater than maxVisualMediaSelectionLimit or lesser than 1.
|
177
|
+
*
|
178
|
+
* @beta
|
179
|
+
*/
|
180
|
+
function retrieveImages(galleryImageInputs: GalleryImageProperties): Promise<VisualMediaFile[]>;
|
181
|
+
/**
|
182
|
+
* @hidden
|
183
|
+
* Checks if visualMedia.image capability is supported by the host
|
184
|
+
* @returns boolean to represent whether visualMedia.image is supported
|
185
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
186
|
+
*
|
187
|
+
* @beta
|
188
|
+
*/
|
189
|
+
function isSupported(): boolean;
|
190
|
+
}
|
191
|
+
export {};
|
192
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* Contains functionality enabling apps to query properties about how the host manages web storage (`Window.LocalStorage`)
|
3
|
+
*
|
4
|
+
* @beta
|
5
|
+
*/
|
6
|
+
export declare namespace webStorage {
|
7
|
+
/**
|
8
|
+
* Checks if web storage (`Window.LocalStorage`) gets cleared when a user logs out from host
|
9
|
+
*
|
10
|
+
* @returns `true` if web storage gets cleared on logout and `false` if not
|
11
|
+
*
|
12
|
+
* @throws `Error` if {@linkcode app.initialize} has not successfully completed
|
13
|
+
*
|
14
|
+
* @beta
|
15
|
+
*/
|
16
|
+
function isWebStorageClearedOnUserLogOut(): Promise<boolean>;
|
17
|
+
/**
|
18
|
+
* Checks if webStorage capability is supported by the host
|
19
|
+
* @returns boolean to represent whether the webStorage capability is supported
|
20
|
+
*
|
21
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
22
|
+
*
|
23
|
+
* @beta
|
24
|
+
*/
|
25
|
+
function isSupported(): boolean;
|
26
|
+
}
|
27
|
+
export declare function clearWebStorageCachedHostNameForTests(): void;
|
@@ -1 +1 @@
|
|
1
|
-
var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","
|
1
|
+
var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"],c={validOrigins:o};export{c as default,o as validOrigins};
|
@@ -1 +1 @@
|
|
1
|
-
export{logs}from"./private/logs.js";export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";export{conversations}from"./private/conversations.js";export{copilot}from"./private/copilot.js";export{externalAppAuthentication}from"./private/externalAppAuthentication.js";export{externalAppAuthenticationForCEA}from"./private/externalAppAuthenticationForCEA.js";export{externalAppCardActions}from"./private/externalAppCardActions.js";export{externalAppCardActionsForCEA}from"./private/externalAppCardActionsForCEA.js";export{externalAppCommands}from"./private/externalAppCommands.js";export{files}from"./private/files.js";export{meetingRoom}from"./private/meetingRoom.js";export{messageChannels}from"./private/messageChannels.js";export{notifications}from"./private/notifications.js";export{otherAppStateChange}from"./private/otherAppStateChange.js";export{remoteCamera}from"./private/remoteCamera.js";export{appEntity}from"./private/appEntity.js";export{teams}from"./private/teams.js";export{videoEffectsEx}from"./private/videoEffectsEx.js";export{hostEntity}from"./private/hostEntity.js";export{
|
1
|
+
export{logs}from"./private/logs.js";export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";export{conversations}from"./private/conversations.js";export{copilot}from"./private/copilot.js";export{externalAppAuthentication}from"./private/externalAppAuthentication.js";export{externalAppAuthenticationForCEA}from"./private/externalAppAuthenticationForCEA.js";export{externalAppCardActions}from"./private/externalAppCardActions.js";export{externalAppCardActionsForCEA}from"./private/externalAppCardActionsForCEA.js";export{externalAppCommands}from"./private/externalAppCommands.js";export{files}from"./private/files.js";export{meetingRoom}from"./private/meetingRoom.js";export{messageChannels}from"./private/messageChannels.js";export{notifications}from"./private/notifications.js";export{otherAppStateChange}from"./private/otherAppStateChange.js";export{remoteCamera}from"./private/remoteCamera.js";export{appEntity}from"./private/appEntity.js";export{teams}from"./private/teams.js";export{videoEffectsEx}from"./private/videoEffectsEx.js";export{hostEntity}from"./private/hostEntity.js";export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{chat}from"./public/chat.js";export{dialog}from"./public/dialog.js";export{nestedAppAuth}from"./public/nestedAppAuth.js";export{geoLocation}from"./public/geoLocation.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{pages}from"./public/pages.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{menus}from"./public/menus.js";export{media}from"./public/media.js";export{secondaryBrowser}from"./public/secondaryBrowser.js";export{location}from"./public/location.js";export{meeting}from"./public/meeting.js";export{monetization}from"./public/monetization.js";export{mail}from"./public/mail.js";export{teamsCore}from"./public/teamsAPIs.js";export{people}from"./public/people.js";export{profile}from"./public/profile.js";export{videoEffects}from"./public/videoEffects.js";export{search}from"./public/search.js";export{sharing}from"./public/sharing.js";export{stageView}from"./public/stageView.js";export{version}from"./public/version.js";export{visualMedia}from"./public/visualMedia.js";export{webStorage}from"./public/webStorage.js";export{thirdPartyCloudStorage}from"./public/thirdPartyCloudStorage.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{tasks}from"./public/tasks.js";export{LiveShareHost,liveShare}from"./public/liveShareHost.js";export{marketplace}from"./public/marketplace.js";import*as e from"./public/authentication.js";export{e as authentication};import*as r from"./public/app.js";export{r as app};import*as t from"./public/appInstallDialog.js";export{t as appInstallDialog};import*as o from"./public/barCode.js";export{o as barCode};import*as p from"./public/clipboard.js";export{p as clipboard};import*as i from"./public/calendar.js";export{i as calendar};import*as a from"./public/call.js";export{a as call};import*as s from"./public/appInitialization.js";export{s as appInitialization};import*as n from"./public/settings.js";export{n as settings};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{sendMessageToParent as i,sendAndHandleStatusAndReason as e,initializeCommunication as t}from"./communication.js";import{defaultSDKVersionForCompatCheck as n}from"./constants.js";import{GlobalVars as o}from"./globalVars.js";import{registerOnThemeChangeHandler as r,initializeHandlers as s}from"./handlers.js";import{ensureInitializeCalled as a,ensureInitialized as l,processAdditionalValidOrigins as m}from"./internalAPIs.js";import{getLogger as p}from"./telemetry.js";import{isNullOrUndefined as c}from"./typeCheckUtilities.js";import{inServerSideRenderingEnvironment as u,runWithTimeout as f,compareSDKVersions as d}from"./utils.js";import{Messages as g}from"../public/app.js";import{initialize as j}from"../public/authentication.js";import{FrameContexts as S}from"../public/constants.js";import{dialog as z}from"../public/dialog.js";import{menus as w}from"../public/menus.js";import{pages as b}from"../public/pages.js";import{runtime as h,applyRuntimeConfig as y,generateVersionBasedTeamsRuntimeConfig as v,mapTeamsVersionToSupportedCapabilities as x,versionAndPlatformAgnosticTeamsRuntimeConfig as C}from"../public/runtime.js";import{version as P}from"../public/version.js";const D=p("app");function V(i,e){if(u()){return D.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return f((()=>function(i,e){return new Promise((r=>{o.initializeCalled||(o.initializeCalled=!0,s(),o.initializePromise=t(e,i).then((({context:i,clientType:e,runtimeConfig:t,clientSupportedSDKVersion:r=n})=>{o.frameContext=i,o.hostClientType=e,o.clientSupportedSDKVersion=r;try{N("Parsing %s",t);const i=JSON.parse(t);if(N("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");t&&y(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{N("Attempting to parse %s as an SDK version",t),isNaN(d(t,n))||(o.clientSupportedSDKVersion=t);const i=JSON.parse(r);if(N("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");y(i)}catch(i){if(!(i instanceof SyntaxError))throw i;y(v(o.clientSupportedSDKVersion,C,x))}}o.initializeCompleted=!0})),j(),w.initialize(),b.config.initialize(),z.initialize()),Array.isArray(e)&&m(e),void 0!==o.initializePromise?r(o.initializePromise):N("GlobalVars.initializePromise is unexpectedly undefined")}))}(i,e)),5e3,new Error("SDK initialization timed out."))}function E(e){i(e,g.AppLoaded,[P])}function K(e,t){i(e,g.ExpectedFailure,[t.reason,t.message])}function A(e,t){i(e,g.Failure,[t.reason,t.message])}function k(e){i(e,g.Success,[P])}const N=D.extend("initializeHelper");function R(i,e){!c(e)&&a(),r(i,e)}function F(i,t){return new Promise((n=>{l(h,S.content,S.sidePanel,S.settings,S.task,S.stage,S.meetingStage),n(e(i,"executeDeepLink",t))}))}export{V as appInitializeHelper,E as notifyAppLoadedHelper,K as notifyExpectedFailureHelper,A as notifyFailureHelper,k as notifySuccessHelper,F as openLinkHelper,R as registerOnThemeChangeHandlerHelper};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as t}from"./telemetry.js";import{latestRuntimeApiVersion as o}from"../public/runtime.js";import{version as s}from"../public/version.js";import{GlobalVars as r}from"./globalVars.js";import{callHandler as a}from"./handlers.js";import{serializeMessageRequest as d,deserializeMessageResponse as c,deserializeMessageRequest as u,serializeMessageResponse as l}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as g}from"./nestedAppAuthUtils.js";import{ssrSafeWindow as p}from"./utils.js";import{UUID as f}from"./uuidObject.js";import{validateOrigin as w}from"./validOrigins.js";const m=n("communication");class h{}class W{}function v(n,i){if(W.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void C("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return N(e,i).then((o=>{o?(function(e,n){r.isFramelessWindow||h.parentWindow&&!h.parentWindow.closed&&e!==h.parentWindow?h.childWindow&&!h.childWindow.closed&&e!==h.childWindow||(h.childWindow=e,h.childOrigin=n):(h.parentWindow=e,h.parentOrigin=n);h.parentWindow&&h.parentWindow.closed&&(h.parentWindow=null,h.parentOrigin=null);h.childWindow&&h.childWindow.closed&&(h.childWindow=null,h.childOrigin=null);K(h.parentWindow),K(h.childWindow)}(e,i),e===h.parentWindow?_(n):e===h.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=u(e.data),[i,o]=a(n.func,n.args);i&&void 0!==o?(z("Returning message %s from child back to child, action: %s.",Z(n),n.func),X(n.id,n.uuid,Array.isArray(o)?o:[o])):(z("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",Z(n),n.func),S(t("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(h.childWindow){const i=e.pop();z("Message from parent being relayed to child, id: %s",Z(n)),X(n.id,n.uuid,e,i)}})))}}(n)):C("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),h.currentWindow=h.currentWindow||p(),h.parentWindow=h.currentWindow.parent!==h.currentWindow.self?h.currentWindow.parent:h.currentWindow.opener,h.topWindow=h.currentWindow.top,(h.parentWindow||n)&&h.currentWindow.addEventListener("message",W.messageListener,!1),!h.parentWindow){const e=h.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));r.isFramelessWindow=!0,e.onNativeMessage=_}try{return h.parentOrigin="*",T(i,"initialize",[s,o,n]).then((([e,n,i,t])=>(g(t,h.currentWindow,{onMessage:Q,sendPostMessage:R}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:t})))}finally{h.parentOrigin=null}}function M(){h.currentWindow&&h.currentWindow.removeEventListener("message",W.messageListener,!1),h.currentWindow=null,h.parentWindow=null,h.parentOrigin=null,h.childWindow=null,h.childOrigin=null,W.parentMessageQueue=[],W.childMessageQueue=[],W.nextMessageId=0,W.callbacks.clear(),W.promiseCallbacks.clear(),W.portCallbacks.clear(),W.legacyMessageIdsToUuidMap={}}function b(e,n,...i){return T(e,n,i).then((([e])=>e))}function y(e,n,...i){return T(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function k(e,n,i,...t){return T(e,n,t).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function I(e,n,...i){return T(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function T(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const o=A(e,n,t);var s;i((s=o.uuid,new Promise((e=>{W.promiseCallbacks.set(s,e)}))))}))}function O(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=A(e,n,t);return s=o.uuid,new Promise(((e,n)=>{W.portCallbacks.set(s,((i,t)=>{i instanceof MessagePort?e(i):n(t&&t.length>0?t[0]:new Error("Host responded without port or error details."))}))}));var s}function S(e,n,t,o){let s;if(t instanceof Function?o=t:t instanceof Array&&(s=t),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=A(e,n,s);o&&W.callbacks.set(r.uuid,o)}W.parentMessageQueue=[],W.childMessageQueue=[],W.topMessageQueue=[],W.nextMessageId=0,W.callbacks=new Map,W.promiseCallbacks=new Map,W.portCallbacks=new Map,W.legacyMessageIdsToUuidMap={};const j=m.extend("sendNestedAuthRequestToTopWindow");function R(e){const n=j,i=h.topWindow,t=function(e){const n=W.nextMessageId++,i=new f;return W.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),args:[],data:e}}(e);return n("Message %s information: %o",Z(t),{actionName:t.func}),P(i,t)}const x=m.extend("sendRequestToTargetWindowHelper");function P(e,n){const i=x,t=J(e),o=d(n);if(r.isFramelessWindow)h.currentWindow&&h.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",Z(o),t),h.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(o)));else{const s=H(e);e&&s?(i("Sending message %s to %s via postMessage",Z(o),t),e.postMessage(o,s)):(i("Adding message %s to %s message queue",Z(o),t),D(e).push(n))}return n}const E=m.extend("sendMessageToParentHelper");function A(e,n,i){const t=E,o=h.parentWindow,s=function(e,n,i){const t=W.nextMessageId++,o=new f;return W.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:n,timestamp:Date.now(),args:i||[],apiVersionTag:e}}(e,n,i);return t("Message %s information: %o",Z(s),{actionName:n,args:i}),P(o,s)}const C=m.extend("processIncomingMessage");const U=m.extend("processAuthBridgeMessage");function Q(e,n){var i,t;const o=U;if(!e||!e.data||"object"!=typeof e.data)return void o("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void o("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.origin);d?N(d,c)?(h.topWindow&&!h.topWindow.closed&&d!==h.topWindow||(h.topWindow=d,h.topOrigin=c),h.topWindow&&h.topWindow.closed&&(h.topWindow=null,h.topOrigin=null),K(h.topWindow),n(r)):o("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):o("Message being ignored by app because it is coming for a target that is null")}const F=m.extend("shouldProcessIncomingMessage");function N(n,i){return e(this,void 0,void 0,(function*(){if(h.currentWindow&&n===h.currentWindow)return F("Should not process message because it is coming from the current window"),!1;if(h.currentWindow&&h.currentWindow.location&&i&&i===h.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return F("Message has an invalid origin of %s",i),!1}const n=yield w(e);return n||F("Message has an invalid origin of %s",i),n}}))}const $=m.extend("handleIncomingMessageFromParent");function L(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function V(e,n){const i=L(n,e.uuid);i&&n.delete(i),e.uuid?W.legacyMessageIdsToUuidMap={}:delete W.legacyMessageIdsToUuidMap[e.id]}function _(e){const n=$;if("id"in e.data&&"number"==typeof e.data.id){const i=e.data,t=c(i),o=function(e){const n=$;if(!e.uuid)return W.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=L(W.callbacks,n);if(i)return i;const t=L(W.promiseCallbacks,n);if(t)return t;const o=L(W.portCallbacks,n);if(o)return o}n("Received message %s that failed to produce a callbackId",Z(e))}(t);if(o){const i=W.callbacks.get(o);n("Received a response from parent for message %s",o.toString()),i&&(n("Invoking the registered callback for message %s with arguments %o",o.toString(),t.args),i.apply(null,[...t.args,t.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",o.toString()),V(t,W.callbacks)));const s=W.promiseCallbacks.get(o);s&&(n("Invoking the registered promise callback for message %s with arguments %o",o.toString(),t.args),s(t.args),n("Removing registered promise callback for message %s",o.toString()),V(t,W.promiseCallbacks));const r=W.portCallbacks.get(o);if(r){let i;n("Invoking the registered port callback for message %s with arguments %o",o.toString(),t.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),r(i,t.args),n("Removing registered port callback for message %s",o.toString()),V(t,W.portCallbacks)}t.uuid&&(W.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const i=e.data;n('Received a message from parent %s, action: "%s"',Z(i),i.func),a(i.func,i.args)}else n("Received an unknown message: %O",e)}const z=m.extend("handleIncomingMessageFromChild");function q(){return h.topWindow!==h.parentWindow}function D(e){return e===h.topWindow&&q()?W.topMessageQueue:e===h.parentWindow?W.parentMessageQueue:e===h.childWindow?W.childMessageQueue:[]}function H(e){return e===h.topWindow&&q()?h.topOrigin:e===h.parentWindow?h.parentOrigin:e===h.childWindow?h.childOrigin:null}function J(e){return e===h.topWindow&&q()?"top":e===h.parentWindow?"parent":e===h.childWindow?"child":null}const B=m.extend("flushMessageQueue");function K(e){const n=H(e),i=D(e),t=J(e);for(;e&&n&&i.length>0;){const o=i.shift();if(o){const i=d(o);B("Flushing message %s from %s message queue via postMessage.",Z(i),t),e.postMessage(i,n)}}}function G(e,n){let i;i=h.currentWindow.setInterval((()=>{0===D(e).length&&(clearInterval(i),n())}),100)}function X(e,n,i,t){const o=h.childWindow,s=function(e,n,i,t){return{id:e,uuid:n,args:i||[],isPartialResponse:t}}(e,n,i,t),r=l(s),a=H(o);o&&a&&o.postMessage(r,a)}function Y(e,n){const i=h.childWindow,t=function(e,n){return{func:e,args:n||[]}}(e,n),o=H(i);i&&o?i.postMessage(t,o):D(i).push(t)}function Z(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{h as Communication,v as initializeCommunication,O as requestPortFromParentWithVersion,I as sendAndHandleSdkError,y as sendAndHandleStatusAndReason,k as sendAndHandleStatusAndReasonWithDefaultError,b as sendAndUnwrap,Y as sendMessageEventToChild,S as sendMessageToParent,T as sendMessageToParentAsync,R as sendNestedAuthRequestToTopWindow,M as uninitializeCommunication,G as waitForMessageQueue};
|
1
|
+
import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as t}from"./telemetry.js";import{isSdkError as o,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{version as d}from"../public/version.js";import{GlobalVars as c}from"./globalVars.js";import{callHandler as u}from"./handlers.js";import{serializeMessageRequest as l,deserializeMessageResponse as g,deserializeMessageRequest as p,serializeMessageResponse as f}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as w}from"./nestedAppAuthUtils.js";import{ssrSafeWindow as m}from"./utils.js";import{UUID as h}from"./uuidObject.js";import{validateOrigin as W}from"./validOrigins.js";const v=n("communication");class M{}class b{}function y(n,i){if(b.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void F("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return q(e,i).then((o=>{o?(function(e,n){c.isFramelessWindow||M.parentWindow&&!M.parentWindow.closed&&e!==M.parentWindow?M.childWindow&&!M.childWindow.closed&&e!==M.childWindow||(M.childWindow=e,M.childOrigin=n):(M.parentWindow=e,M.parentOrigin=n);M.parentWindow&&M.parentWindow.closed&&(M.parentWindow=null,M.parentOrigin=null);M.childWindow&&M.childWindow.closed&&(M.childWindow=null,M.childOrigin=null);ne(M.parentWindow),ne(M.childWindow)}(e,i),e===M.parentWindow?B(n):e===M.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=p(e.data),[i,o]=u(n.func,n.args);i&&void 0!==o?(K("Returning message %s from child back to child, action: %s.",se(n),n.func),te(n.id,n.uuid,Array.isArray(o)?o:[o])):(K("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",se(n),n.func),C(t("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(M.childWindow){const i=e.pop();K("Message from parent being relayed to child, id: %s",se(n)),te(n.id,n.uuid,e,i)}})))}}(n)):F("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),M.currentWindow=M.currentWindow||m(),M.parentWindow=M.currentWindow.parent!==M.currentWindow.self?M.currentWindow.parent:M.currentWindow.opener,M.topWindow=M.currentWindow.top,(M.parentWindow||n)&&M.currentWindow.addEventListener("message",b.messageListener,!1),!M.parentWindow){const e=M.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));c.isFramelessWindow=!0,e.onNativeMessage=B}try{return M.parentOrigin="*",T(i,"initialize",[d,r,n]).then((([e,n,i,t])=>(w(t,M.currentWindow,{onMessage:_,sendPostMessage:N}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:t})))}finally{M.parentOrigin=null}}function k(){M.currentWindow&&M.currentWindow.removeEventListener("message",b.messageListener,!1),M.currentWindow=null,M.parentWindow=null,M.parentOrigin=null,M.childWindow=null,M.childOrigin=null,b.parentMessageQueue=[],b.childMessageQueue=[],b.nextMessageId=0,b.callbacks.clear(),b.promiseCallbacks.clear(),b.portCallbacks.clear(),b.legacyMessageIdsToUuidMap={}}function I(e,n,...i){return T(e,n,i).then((([e])=>e))}function R(e,n,...i){return T(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function E(e,n,i,...t){return T(e,n,t).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function O(e,n,...i){return T(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function T(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const o=z(e,n,t);var s;i((s=o.uuid,new Promise((e=>{b.promiseCallbacks.set(s,e)}))))}))}function S(e){return e.map((e=>a(e)?e.serialize():e))}function j(n,i,t,r,a){var d;return e(this,void 0,void 0,(function*(){const e=S(i),[c]=yield T(r,n,e);if(a&&a(c)||!a&&o(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(t.validate(c))return t.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function x(n,i,t,r){var a;return e(this,void 0,void 0,(function*(){const e=S(i),[d]=yield T(t,n,e);if(r&&r(d)||!r&&o(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function A(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=z(e,n,t);return s=o.uuid,new Promise(((e,n)=>{b.portCallbacks.set(s,((i,t)=>{i instanceof MessagePort?e(i):n(t&&t.length>0?t[0]:new Error("Host responded without port or error details."))}))}));var s}function C(e,n,t,o){let s;if(t instanceof Function?o=t:t instanceof Array&&(s=t),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=z(e,n,s);o&&b.callbacks.set(r.uuid,o)}b.parentMessageQueue=[],b.childMessageQueue=[],b.topMessageQueue=[],b.nextMessageId=0,b.callbacks=new Map,b.promiseCallbacks=new Map,b.portCallbacks=new Map,b.legacyMessageIdsToUuidMap={};const P=v.extend("sendNestedAuthRequestToTopWindow");function N(e){const n=P,i=M.topWindow,t=function(e){const n=b.nextMessageId++,i=new h;return b.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),args:[],data:e}}(e);return n("Message %s information: %o",se(t),{actionName:t.func}),U(i,t)}const $=v.extend("sendRequestToTargetWindowHelper");function U(e,n){const i=$,t=Z(e),o=l(n);if(c.isFramelessWindow)M.currentWindow&&M.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",se(o),t),M.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(o)));else{const s=Y(e);e&&s?(i("Sending message %s to %s via postMessage",se(o),t),e.postMessage(o,s)):(i("Adding message %s to %s message queue",se(o),t),X(e).push(n))}return n}const Q=v.extend("sendMessageToParentHelper");function z(e,n,i){const t=Q,o=M.parentWindow,s=function(e,n,i){const t=b.nextMessageId++,o=new h;return b.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:n,timestamp:Date.now(),args:i||[],apiVersionTag:e}}(e,n,i);return t("Message %s information: %o",se(s),{actionName:n,args:i}),U(o,s)}const F=v.extend("processIncomingMessage");const L=v.extend("processAuthBridgeMessage");function _(e,n){var i,t;const o=L;if(!e||!e.data||"object"!=typeof e.data)return void o("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void o("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.origin);d?q(d,c)?(M.topWindow&&!M.topWindow.closed&&d!==M.topWindow||(M.topWindow=d,M.topOrigin=c),M.topWindow&&M.topWindow.closed&&(M.topWindow=null,M.topOrigin=null),ne(M.topWindow),n(r)):o("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):o("Message being ignored by app because it is coming for a target that is null")}const V=v.extend("shouldProcessIncomingMessage");function q(n,i){return e(this,void 0,void 0,(function*(){if(M.currentWindow&&n===M.currentWindow)return V("Should not process message because it is coming from the current window"),!1;if(M.currentWindow&&M.currentWindow.location&&i&&i===M.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return V("Message has an invalid origin of %s",i),!1}const n=yield W(e);return n||V("Message has an invalid origin of %s",i),n}}))}const D=v.extend("handleIncomingMessageFromParent");function H(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function J(e,n){const i=H(n,e.uuid);i&&n.delete(i),e.uuid?b.legacyMessageIdsToUuidMap={}:delete b.legacyMessageIdsToUuidMap[e.id]}function B(e){const n=D;if("id"in e.data&&"number"==typeof e.data.id){const i=e.data,t=g(i),o=function(e){const n=D;if(!e.uuid)return b.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=H(b.callbacks,n);if(i)return i;const t=H(b.promiseCallbacks,n);if(t)return t;const o=H(b.portCallbacks,n);if(o)return o}n("Received message %s that failed to produce a callbackId",se(e))}(t);if(o){const i=b.callbacks.get(o);n("Received a response from parent for message %s",o.toString()),i&&(n("Invoking the registered callback for message %s with arguments %o",o.toString(),t.args),i.apply(null,[...t.args,t.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",o.toString()),J(t,b.callbacks)));const s=b.promiseCallbacks.get(o);s&&(n("Invoking the registered promise callback for message %s with arguments %o",o.toString(),t.args),s(t.args),n("Removing registered promise callback for message %s",o.toString()),J(t,b.promiseCallbacks));const r=b.portCallbacks.get(o);if(r){let i;n("Invoking the registered port callback for message %s with arguments %o",o.toString(),t.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),r(i,t.args),n("Removing registered port callback for message %s",o.toString()),J(t,b.portCallbacks)}t.uuid&&(b.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const i=e.data;n('Received a message from parent %s, action: "%s"',se(i),i.func),u(i.func,i.args)}else n("Received an unknown message: %O",e)}const K=v.extend("handleIncomingMessageFromChild");function G(){return M.topWindow!==M.parentWindow}function X(e){return e===M.topWindow&&G()?b.topMessageQueue:e===M.parentWindow?b.parentMessageQueue:e===M.childWindow?b.childMessageQueue:[]}function Y(e){return e===M.topWindow&&G()?M.topOrigin:e===M.parentWindow?M.parentOrigin:e===M.childWindow?M.childOrigin:null}function Z(e){return e===M.topWindow&&G()?"top":e===M.parentWindow?"parent":e===M.childWindow?"child":null}const ee=v.extend("flushMessageQueue");function ne(e){const n=Y(e),i=X(e),t=Z(e);for(;e&&n&&i.length>0;){const o=i.shift();if(o){const i=l(o);ee("Flushing message %s from %s message queue via postMessage.",se(i),t),e.postMessage(i,n)}}}function ie(e,n){let i;i=M.currentWindow.setInterval((()=>{0===X(e).length&&(clearInterval(i),n())}),100)}function te(e,n,i,t){const o=M.childWindow,s=function(e,n,i,t){return{id:e,uuid:n,args:i||[],isPartialResponse:t}}(e,n,i,t),r=f(s),a=Y(o);o&&a&&o.postMessage(r,a)}function oe(e,n){const i=M.childWindow,t=function(e,n){return{func:e,args:n||[]}}(e,n),o=Y(i);i&&o?i.postMessage(t,o):X(i).push(t)}function se(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{M as Communication,x as callFunctionInHost,j as callFunctionInHostAndHandleResponse,y as initializeCommunication,A as requestPortFromParentWithVersion,O as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,E as sendAndHandleStatusAndReasonWithDefaultError,I as sendAndUnwrap,oe as sendMessageEventToChild,C as sendMessageToParent,T as sendMessageToParentAsync,N as sendNestedAuthRequestToTopWindow,k as uninitializeCommunication,ie as waitForMessageQueue};
|
@@ -1 +1 @@
|
|
1
|
-
import{teamsDeepLinkProtocol as n,teamsDeepLinkHost as o}from"./constants.js";import{teamsDeepLinkUsersUrlParameterName as e,
|
1
|
+
import{teamsDeepLinkProtocol as n,teamsDeepLinkHost as o}from"./constants.js";import{teamsDeepLinkUsersUrlParameterName as e,teamsDeepLinkUrlPathForCall as t,teamsDeepLinkAttendeesUrlParameterName as $,teamsDeepLinkUrlPathForCalendar as i,teamsDeepLinkUrlPathForAppInstall as r,teamsDeepLinkUrlPathForChat as d,teamsDeepLinkWithVideoUrlParameterName as p,teamsDeepLinkSourceUrlParameterName as c,teamsDeepLinkStartTimeUrlParameterName as a,teamsDeepLinkEndTimeUrlParameterName as m,teamsDeepLinkSubjectUrlParameterName as s,teamsDeepLinkContentUrlParameterName as C,teamsDeepLinkTopicUrlParameterName as I,teamsDeepLinkMessageUrlParameterName as l}from"./deepLinkConstants.js";function u(t,$,i){if(0===t.length)throw new Error("Must have at least one user when creating a chat deep link");const r=`${e}=`+t.map((n=>encodeURIComponent(n))).join(","),p=void 0===$?"":`&${I}=${encodeURIComponent($)}`,c=void 0===i?"":`&${l}=${encodeURIComponent(i)}`;return`${n}://${o}${d}?${r}${p}${c}`}function R($,i,r){if(0===$.length)throw new Error("Must have at least one target when creating a call deep link");const d=`${e}=`+$.map((n=>encodeURIComponent(n))).join(","),a=void 0===i?"":`&${p}=${encodeURIComponent(i)}`,m=void 0===r?"":`&${c}=${encodeURIComponent(r)}`;return`${n}://${o}${t}?${d}${a}${m}`}function U(e,t,r,d,p){const c=void 0===e?"":`${$}=`+e.map((n=>encodeURIComponent(n))).join(","),I=void 0===t?"":`&${a}=${encodeURIComponent(t)}`,l=void 0===r?"":`&${m}=${encodeURIComponent(r)}`,u=void 0===d?"":`&${s}=${encodeURIComponent(d)}`,R=void 0===p?"":`&${C}=${encodeURIComponent(p)}`;return`${n}://${o}${i}?${c}${I}${l}${u}${R}`}function h(e){if(!e)throw new Error("App ID must be set when creating an app install dialog deep link");return`${n}://${o}${r}${encodeURIComponent(e)}`}export{h as createTeamsDeepLinkForAppInstallDialog,U as createTeamsDeepLinkForCalendar,R as createTeamsDeepLinkForCall,u as createTeamsDeepLinkForChat};
|
@@ -0,0 +1 @@
|
|
1
|
+
class e{}class r extends e{validate(e){return!0}deserialize(e){return e}}export{e as ResponseHandler,r as SimpleTypeResponseHandler};
|
@@ -1 +1 @@
|
|
1
|
-
import{sendMessageToParentAsync as e}from"../internal/communication.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{
|
1
|
+
import{sendMessageToParentAsync as e}from"../internal/communication.js";import{ensureInitialized as t}from"../internal/internalAPIs.js";import{ResponseHandler as n}from"../internal/responseHandler.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{validateId as o,validateUrl as r}from"../internal/utils.js";import{FrameContexts as s,errorNotSupportedOnPlatform as a}from"../public/constants.js";import{runtime as u}from"../public/runtime.js";import{AppId as c}from"../public/appId.js";const h="v2";var l;!function(l){let p;var f;l.SerializableActionExecuteInvokeRequest=class{constructor(e){this.invokeRequest=e}serialize(){return this.invokeRequest}},l.isActionExecuteResponse=function(e){const t=e;return t.responseType===l.InvokeResponseType.ActionExecuteInvokeResponse&&void 0!==t.value&&void 0!==t.statusCode&&void 0!==t.type},l.ActionExecuteInvokeRequestType="Action.Execute",function(e){e.ActionExecuteInvokeRequest="ActionExecuteInvokeRequest",e.QueryMessageExtensionRequest="QueryMessageExtensionRequest"}(p=l.OriginalRequestType||(l.OriginalRequestType={})),(f=l.InvokeResponseType||(l.InvokeResponseType={})).ActionExecuteInvokeResponse="ActionExecuteInvokeResponse",f.QueryMessageExtensionResponse="QueryMessageExtensionResponse";let R;function d(e){if(e.requestType===p.ActionExecuteInvokeRequest){const t=e;if(t.type!==l.ActionExecuteInvokeRequestType){throw{errorCode:R.INTERNAL_ERROR,message:`Invalid action type ${t.type}. Action type must be "${l.ActionExecuteInvokeRequestType}"`}}}else if(e.requestType===p.QueryMessageExtensionRequest){if(e.commandId.length>64)throw new Error("originalRequestInfo.commandId exceeds the maximum size of 64 characters");if(e.parameters.length>5)throw new Error("originalRequestInfo.parameters exceeds the maximum size of 5");for(const t of e.parameters){if(t.name.length>64)throw new Error("originalRequestInfo.parameters.name exceeds the maximum size of 64 characters");if(t.value.length>512)throw new Error("originalRequestInfo.parameters.value exceeds the maximum size of 512 characters")}}}function m(){return!(!t(u)||!u.supports.externalAppAuthentication)}l.ActionExecuteResponseHandler=class extends n{validate(e){return l.isActionExecuteResponse(e)}deserialize(e){return e}},l.isInvokeError=function(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.values(l.InvokeErrorCode).includes(t.errorCode)&&(void 0===t.message||"string"==typeof t.message)},function(e){e.INTERNAL_ERROR="INTERNAL_ERROR"}(R=l.InvokeErrorCode||(l.InvokeErrorCode={})),l.authenticateAndResendRequest=function(n,o,r){if(t(u,s.content),!m())throw a;const l=new c(n);return d(r),e(i(h,"externalAppAuthentication.authenticateAndResendRequest"),"externalAppAuthentication.authenticateAndResendRequest",[l.toString(),r,o.url.href,o.width,o.height,o.isExternal]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))},l.authenticateWithSSO=function(n,o){if(t(u,s.content),!m())throw a;const r=new c(n);return e(i(h,"externalAppAuthentication.authenticateWithSSO"),"externalAppAuthentication.authenticateWithSSO",[r.toString(),o.claims,o.silent]).then((([e,t])=>{if(!e)throw t}))},l.authenticateWithSSOAndResendRequest=function(n,o,r){if(t(u,s.content),!m())throw a;const l=new c(n);return d(r),e(i(h,"externalAppAuthentication.authenticateWithSSOAndResendRequest"),"externalAppAuthentication.authenticateWithSSOAndResendRequest",[l.toString(),r,o.claims,o.silent]).then((([e,t])=>{if(e&&null!=t.responseType)return t;throw t}))},l.authenticateWithOauth2=function(n,r,c){if(t(u,s.content),!m())throw a;return o(n,new Error("titleId is Invalid.")),o(r,new Error("oauthConfigId is Invalid.")),e(i(h,"externalAppAuthentication.authenticateWithOauth2"),"externalAppAuthentication.authenticateWithOauth2",[n,r,c.width,c.height,c.isExternal]).then((([e,t])=>{if(!e)throw t}))},l.authenticateWithPowerPlatformConnectorPlugins=function(n,c,l){if(t(u,s.content),!m())throw a;return o(n,new Error("titleId is Invalid.")),c&&r(c),e(i(h,"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins"),"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[n,null==c?void 0:c.toString(),null==l?void 0:l.width,null==l?void 0:l.height,null==l?void 0:l.isExternal]).then((([e,t])=>{if(!e)throw t}))},l.isSupported=m}(l||(l={}));export{l as externalAppAuthentication};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{
|
1
|
+
import{__awaiter as t}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.0_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{callFunctionInHost as e,callFunctionInHostAndHandleResponse as n}from"../internal/communication.js";import{ensureInitialized as i}from"../internal/internalAPIs.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{validateId as r}from"../internal/utils.js";import{FrameContexts as a,errorNotSupportedOnPlatform as u}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{externalAppAuthentication as c}from"./externalAppAuthentication.js";const p="v2";var h;!function(h){function l(){return!(!i(s)||!s.supports.externalAppAuthenticationForCEA)}function A(t){if(t.type!==c.ActionExecuteInvokeRequestType){throw{errorCode:c.InvokeErrorCode.INTERNAL_ERROR,message:`Invalid action type ${t.type}. Action type must be "${c.ActionExecuteInvokeRequestType}"`}}}h.authenticateWithSSO=function(n,h,A){return t(this,void 0,void 0,(function*(){if(i(s,a.content),!l())throw u;return r(h,new Error("conversation id is not valid.")),e("externalAppAuthenticationForCEA.authenticateWithSSO",[n,h,A.claims,A.silent],o(p,"externalAppAuthenticationForCEA.authenticateWithSSO"),c.isInvokeError)}))},h.authenticateWithOauth=function(n,h,A){return t(this,void 0,void 0,(function*(){if(i(s,a.content),!l())throw u;return r(h,new Error("conversation id is not valid.")),e("externalAppAuthenticationForCEA.authenticateWithOauth",[n,h,A.url.href,A.width,A.height,A.isExternal],o(p,"externalAppAuthenticationForCEA.authenticateWithOauth"),c.isInvokeError)}))},h.authenticateAndResendRequest=function(e,h,d,v){return t(this,void 0,void 0,(function*(){if(i(s,a.content),!l())throw u;return r(h,new Error("conversation id is not valid.")),A(v),n("externalAppAuthenticationForCEA.authenticateAndResendRequest",[e,h,new c.SerializableActionExecuteInvokeRequest(v),d.url.href,d.width,d.height,d.isExternal],new c.ActionExecuteResponseHandler,o(p,"externalAppAuthenticationForCEA.authenticateAndResendRequest"),c.isInvokeError)}))},h.authenticateWithSSOAndResendRequest=function(e,h,d,v){return t(this,void 0,void 0,(function*(){if(i(s,a.content),!l())throw u;return r(h,new Error("conversation id is not valid.")),A(v),n("externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",[e,h,new c.SerializableActionExecuteInvokeRequest(v),d.claims,d.silent],new c.ActionExecuteResponseHandler,o(p,"externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest"),c.isInvokeError)}))},h.isSupported=l}(h||(h={}));export{h as externalAppAuthenticationForCEA};
|
@@ -1 +1 @@
|
|
1
|
-
import{
|
1
|
+
import{callFunctionInHostAndHandleResponse as t}from"../internal/communication.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{SimpleTypeResponseHandler as e,ResponseHandler as n}from"../internal/responseHandler.js";import{getApiVersionTag as o}from"../internal/telemetry.js";import{runtime as a}from"../public/runtime.js";import{ErrorCode as s}from"../public/interfaces.js";const i="v2";var u;!function(u){(u.AppTypes||(u.AppTypes={})).edu="EDU";class d{constructor(t){this.hostEntityId=t}serialize(){return this.hostEntityId}}!function(l){class c extends n{validate(t){return"ConfigurableTab"===t.tabType}deserialize(t){return t}}class p{constructor(t){this.configurableTabInstance=t}serialize(){return this.configurableTabInstance}}class f extends n{validate(t){return"ConfigurableTab"===t.tabType||"StaticTab"===t.tabType}deserialize(t){return t}}class E{constructor(t){this.hostEntityTabInstance=t}serialize(){return this.hostEntityTabInstance}}class h extends n{validate(t){return t.allTabs&&t.allTabs.forEach((t=>{})),!0}deserialize(t){return t}}function m(){var t;return!!(r(a)&&u.isSupported()&&(null===(t=a.supports.hostEntity)||void 0===t?void 0:t.tab))}function b(t){if(!t||0==t.length)throw new Error(`Error code: ${s.INVALID_ARGUMENTS}, message: ThreadId cannot be null or empty`)}function T(t){if(!(null==t?void 0:t.internalTabInstanceId)||0===t.internalTabInstanceId.length)throw new Error(`Error code: ${s.INVALID_ARGUMENTS}, message: TabId cannot be null or empty`)}l.addAndConfigure=function(e,n){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);if(b(e.threadId),n&&0===n.length)throw new Error(`Error code: ${s.INVALID_ARGUMENTS}, message: App types cannot be an empty array`);return t("hostEntity.tab.addAndConfigure",[new d(e),n],new f,o(i,"hostEntity.tab.addAndConfigure"))},l.getAll=function(e){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return b(e.threadId),t("hostEntity.tab.getAll",[new d(e)],new h,o(i,"hostEntity.tab.getAll"))},l.reconfigure=function(e,n){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return T(e),b(n.threadId),t("hostEntity.tab.reconfigure",[new p(e),new d(n)],new c,o(i,"hostEntity.tab.reconfigure"))},l.rename=function(e,n){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return T(e),b(n.threadId),t("hostEntity.tab.rename",[new p(e),new d(n)],new c,o(i,"hostEntity.tab.rename"))},l.remove=function(n,u){if(r(a),!m())throw new Error(`Error code: ${s.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return b(u.threadId),T(n),t("hostEntity.tab.remove",[new E(n),new d(u)],new e,o(i,"hostEntity.tab.remove"))},l.isSupported=m}(u.tab||(u.tab={})),u.isSupported=function(){return!(!r(a)||!a.supports.hostEntity)}}(u||(u={}));export{u as hostEntity};
|