From 8fa544dfc32de63721b2fcc77cb495e6bd6b0035 Mon Sep 17 00:00:00 2001 From: Daniel Fried Date: Wed, 29 Jun 2022 09:56:15 -0700 Subject: [PATCH] 0.16.1 --- README.md | 47 ++++++++++++++-- dist/sdk.d.ts | 62 +++++++++++++++++---- dist/sdk.es.js | 130 ++++++++++++++++++++++++--------------------- dist/sdk.module.js | 130 ++++++++++++++++++++++++--------------------- package.json | 4 +- 5 files changed, 238 insertions(+), 135 deletions(-) diff --git a/README.md b/README.md index 65e7c26..70d7113 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ The Zoom Apps SDK is a JavaScript library that faciliates communication between your Zoom App and the Zoom client. The SDK allows you to take advantage of the many APIs and events Zoom exposes in its embedded browser. -## Usage +## Installation -There are two ways to use the Zoom Apps SDK. +There are two ways to install the Zoom Apps SDK into your frontend project ### NPM @@ -22,4 +22,45 @@ Alternatively, you can load the SDK from a CDN, using a script tag in your HTML ``` -If you choose to use the CDN, note that the SDK is unversioned and subject to on-demand updates. Because of this, you will need to specify an additional parameter `version` when calling `zoomSdk.config`. +## Usage + +If you installed Zoom Apps SDK from NPM, import `zoomSdk` into the component where you wanted to use the SDK and call `config` as your first call to verify your application with Zoom. + +``` +import zoomSdk from "@zoom/appssdk" + +async function configureApp { + const configResponse = await zoomSdk.config({ + popoutSize: {width: 480, height: 360}, + capabilities: ["shareApp"] + }) +} +``` + +When you load the SDK using a script tag, zoomSDK is served as a global object and can be called across components. Even in this case `zoomSdk.config` should be the first call. + +``` +async function configureApp { + const configResponse = await zoomSdk.config({ + version: "0.16" + popoutSize: {width: 480, height: 360}, + capabilities: ["shareApp"] + }) +} +``` + + +The cloud SDK is designed to provide on-demand patch updates, and it does not support exact versions. You will always get the latest patch version within the major version specified in the version parameter of `zoomSdk.config`. In other words, if you supplied an exact version like `0.16.1`, you will get the latest patch within the `0.16` major version. + + +## Documentation + +Refer to Apps SDK documentation [here](https://marketplace.zoom.us/docs/zoom-apps/js-sdk/reference) + +## Resources to create a Zoom App + +- Create your first Zoom App following these [steps](https://marketplace.zoom.us/docs/zoom-apps/getstarted). +- To help you start developing Zoom Apps we also provide sample reference [apps](https://marketplace.zoom.us/docs/zoom-apps/referenceapp#quick-start-reference-apps). +- Watch [How to Create a Zoom App](https://www.youtube.com/watch?v=otlyDxnU-RI) and [How To Configure the Basic Zoom App](https://www.youtube.com/watch?v=SS87nqO9ScQ). +- Discover more learning [resources](https://marketplace.zoom.us/docs/zoom-apps/introduction) for Zoom Apps Development. +- Zoom Apps SDK on [npm](https://www.npmjs.com/package/@zoom/appssdk) diff --git a/dist/sdk.d.ts b/dist/sdk.d.ts index 4349839..cbe37a2 100644 --- a/dist/sdk.d.ts +++ b/dist/sdk.d.ts @@ -20,10 +20,18 @@ * SOFTWARE. */ +/** + * @deprecated + */ declare const ZERO_SIXTEEN_ZERO = "0.16.0"; +declare const ZERO_SIXTEEN = "0.16"; +/** + * @deprecated + */ declare const ZERO_FOURTEEN_ZERO = "0.14.0"; +declare const ZERO_FOURTEEN = "0.14"; -declare type SdkVersion = typeof ZERO_FOURTEEN_ZERO | typeof ZERO_SIXTEEN_ZERO; +declare type SdkVersion = typeof ZERO_FOURTEEN | typeof ZERO_FOURTEEN_ZERO | typeof ZERO_SIXTEEN | typeof ZERO_SIXTEEN_ZERO; declare type GeneralMessage = 'Success' | 'Failure'; /** * @returns {string} Success, if no error @@ -659,10 +667,12 @@ declare type ConfigOptions = { popoutSize?: ConfigSize; /** target SDK version, required if loading SDK from Zoom Apps CDN * ``` - * const zoomSdk = new ZoomSdk({ version: '0.16.0' }) + * const zoomSdk = new ZoomSdk({ version: '0.16' }) * ``` */ version?: SdkVersion; + /** @hidden */ + size?: ConfigSize; }; declare type AuthObject = { status: 'authorized' | 'unauthorized'; @@ -741,7 +751,7 @@ declare type GetMeetingContextResponse = { meetingTopic: string; meetingID: string; }; -declare type Apis = 'addBreakoutRoom' | 'allowParticipantToRecord' | 'assignParticipantsToBreakoutRoom' | 'assignParticipantToBreakoutRoom' | 'authorize' | 'canSupportVirtualBackground' | 'changeBreakoutRoom' | 'clearImage' | 'clearParticipant' | 'clearWebView' | 'closeBreakoutRooms' | 'closeChannel' | 'closeLobby' | 'closeRenderingContext' | 'cloudRecording' | 'configureBreakoutRooms' | 'connect' | 'createBreakoutRooms' | 'deleteBreakoutRoom' | 'drawImage' | 'drawParticipant' | 'drawWebView' | 'endCollaborate' | 'endSyncData' | 'executeOnZoomAction' | 'expandApp' | 'getBreakoutRoomList' | 'getImmersiveViewContext' | 'getMeetingContext' | 'getMeetingJoinUrl' | 'getMeetingParticipants' | 'getMeetingUUID' | 'getMyOpenedAppList' | 'getOnZoomProperties' | 'getPairingStatus' | 'getRecordingContext' | 'getRunningContext' | 'getScreenshot' | 'getSupportedJsApis' | 'getUserContext' | 'getUserMediaAudio' | 'getUserMediaVideo' | 'joinCollaborate' | 'joinOnZoomEvent' | 'joinZoomRoom' | 'launchAppInMeeting' | 'leaveCollaborate' | 'listCameras' | 'onActiveSpeakerChange' | 'onAppPopout' | 'onAuthenticate' | 'onAuthorized' | 'onBreakoutRoomChange' | 'onCloseAppForParticipants' | 'onCloudRecording' | 'onCollaborateChange' | 'onConnect' | 'onExpandApp' | 'onExtendedProcessing' | 'onImmersiveViewChange' | 'onMeeting' | 'onMeetingConfigChanged' | 'onMessage' | 'onMyActiveSpeakerChange' | 'onMyAppListChanged' | 'onMyMediaChange' | 'onMyReaction' | 'onMyUserContextChange' | 'onOnZoomJoinStatusChange' | 'onOpenCloseApp' | 'onPairingStatusChange' | 'onParticipantChange' | 'onReaction' | 'onRunningContextChange' | 'onSendAppInvitation' | 'onShareApp' | 'onThemeModeChange' | 'onUserAction' | 'openApp' | 'openBreakoutRooms' | 'openChannel' | 'openDM' | 'openUrl' | 'postMessage' | 'promptAuthorize' | 'pushState' | 'removeImmersiveView' | 'removeVirtualBackground' | 'removeVirtualForeground' | 'renameBreakoutRoom' | 'runRenderingContext' | 'sendAppInvitation' | 'sendAppInvitationToAllParticipants' | 'sendAppInvitationToMeetingOwner' | 'setAuthCancel' | 'setAuthResult' | 'setCamera' | 'setImmersiveView' | 'setUserMediaAudio' | 'setUserMediaVideo' | 'setVideoMirrorEffect' | 'setVirtualBackground' | 'setVirtualForeground' | 'shareApp' | 'showAppInvitationDialog' | 'showNotification' | 'startCollaborate' | 'toggleParticipantMediaAudio' | 'onInviteCollaboration'; +declare type Apis = 'addBreakoutRoom' | 'allowParticipantToRecord' | 'assignParticipantsToBreakoutRoom' | 'assignParticipantToBreakoutRoom' | 'authorize' | 'changeBreakoutRoom' | 'clearImage' | 'clearParticipant' | 'clearWebView' | 'closeBreakoutRooms' | 'closeChannel' | 'closeLobby' | 'closeRenderingContext' | 'cloudRecording' | 'configureBreakoutRooms' | 'connect' | 'createBreakoutRooms' | 'deleteBreakoutRoom' | 'drawImage' | 'drawParticipant' | 'drawWebView' | 'endCollaborate' | 'endSyncData' | 'executeOnZoomAction' | 'expandApp' | 'getBreakoutRoomList' | 'getImmersiveViewContext' | 'getMeetingContext' | 'getMeetingJoinUrl' | 'getMeetingParticipants' | 'getMeetingUUID' | 'getMyOpenedAppList' | 'getOnZoomProperties' | 'getPairingStatus' | 'getRecordingContext' | 'getRunningContext' | 'getScreenshot' | 'getSupportedJsApis' | 'getUserContext' | 'getUserMediaAudio' | 'getUserMediaVideo' | 'joinCollaborate' | 'joinOnZoomEvent' | 'joinZoomRoom' | 'launchAppInMeeting' | 'leaveCollaborate' | 'listCameras' | 'onActiveSpeakerChange' | 'onAppPopout' | 'onAuthenticate' | 'onAuthorized' | 'onBreakoutRoomChange' | 'onCloseAppForParticipants' | 'onCloudRecording' | 'onCollaborateChange' | 'onConnect' | 'onExpandApp' | 'onExtendedProcessing' | 'onImmersiveViewChange' | 'onMeeting' | 'onMeetingConfigChanged' | 'onMessage' | 'onMyActiveSpeakerChange' | 'onMyAppListChanged' | 'onMyMediaChange' | 'onMyReaction' | 'onMyUserContextChange' | 'onOnZoomJoinStatusChange' | 'onOpenCloseApp' | 'onPairingStatusChange' | 'onParticipantChange' | 'onReaction' | 'onRunningContextChange' | 'onSendAppInvitation' | 'onShareApp' | 'onThemeModeChange' | 'onUserAction' | 'openApp' | 'openBreakoutRooms' | 'openChannel' | 'openDM' | 'openUrl' | 'postMessage' | 'promptAuthorize' | 'pushState' | 'removeImmersiveView' | 'removeVirtualBackground' | 'removeVirtualForeground' | 'renameBreakoutRoom' | 'runRenderingContext' | 'sendAppInvitation' | 'sendAppInvitationToAllParticipants' | 'sendAppInvitationToMeetingOwner' | 'setAuthCancel' | 'setAuthResult' | 'setCamera' | 'setImmersiveView' | 'setUserMediaAudio' | 'setUserMediaVideo' | 'setVideoMirrorEffect' | 'setVirtualBackground' | 'setVirtualForeground' | 'shareApp' | 'showAppInvitationDialog' | 'showNotification' | 'startCollaborate' | 'toggleParticipantMediaAudio' | 'onInviteCollaboration'; /** * Example: * ``` @@ -1349,9 +1359,9 @@ declare type ToggleParticipantMediaAudioOptions = { * * The Zoom Apps SDK is a JavaScript library that faciliates communication between your Zoom App and the Zoom client. The SDK allows you to take advantage of the many APIs and events Zoom exposes in its embedded browser. * - * ## Usage + * ## Installation * - * There are two ways to use the Zoom Apps SDK. + * There are two ways to install the Zoom Apps SDK into your frontend project * * ### NPM * @@ -1368,9 +1378,42 @@ declare type ToggleParticipantMediaAudioOptions = { * ``` * * ``` + * ## Usage + * + * If you installed Zoom Apps SDK from NPM, import `zoomSdk` into the component where you wanted to use the SDK and call `config` as your first call to verify your application with Zoom. + * + * ``` + * import zoomSdk from "@zoom/appssdk" + * + * async function configureApp { + * const configResponse = await zoomSdk.config({ + * popoutSize: {width: 480, height: 360}, + * capabilities: ["shareApp"] + * }) + * } + * ``` + * + * When you load the SDK using a script tag, zoomSDK is served as a global object and can be called across components. Even in this case `zoomSdk.config` should be the first call. + * + * ``` + * async function configureApp { + * const configResponse = await zoomSdk.config({ + * version: "0.16" + * popoutSize: {width: 480, height: 360}, + * capabilities: ["shareApp"] + * }) + * } + * ``` + * + * The cloud SDK is designed to provide on-demand patch updates, and it does not support exact versions. You will always get the latest patch version within the major version specified in the version parameter of `zoomSdk.config`. In other words, if you supplied an exact version like `0.16.1`, you will get the latest patch within the `0.16` major version. * - * If you choose to use the CDN, note that the SDK is unversioned and subject to on-demand updates. Because of this, you will need to specify an additional parameter `version` when calling `zoomSdk.config`. + * ## Resources to create a Zoom App * + * - Create your first Zoom App following these [steps](https://marketplace.zoom.us/docs/zoom-apps/getstarted). + * - To help you start developing Zoom Apps we also provide sample reference [apps](https://marketplace.zoom.us/docs/zoom-apps/referenceapp#quick-start-reference-apps). + * - Watch [How to Create a Zoom App](https://www.youtube.com/watch?v=otlyDxnU-RI) and [How To Configure the Basic Zoom App](https://www.youtube.com/watch?v=SS87nqO9ScQ). + * - Discover more learning [resources](https://marketplace.zoom.us/docs/zoom-apps/introduction) for Zoom Apps Development. + * - Zoom Apps SDK on [npm](https://www.npmjs.com/package/@zoom/appssdk) */ declare class ZoomSdk { private _postMessage; @@ -1401,7 +1444,9 @@ declare class ZoomSdk { * If your Zoom App is a single page app, we suggest modifying your navigation methods to automate this. * ``` * const configResponse = await zoomSdk.config({ - * version: '0.16.0', + * version: '0.16', + * // The `version` param is only required if using the Cloud SDK (not NPM SDK). + * // See README for more details. * popoutSize: { width: 480, height: 360 }, * capabilities: [ * //APIs @@ -1418,7 +1463,6 @@ declare class ZoomSdk { * "showNotification", * "openUrl", * "setVirtualBackground", - * "canSupportVirtualBackground", * "listCameras", * "setCamera", * "sendAppInvitation", @@ -1451,7 +1495,7 @@ declare class ZoomSdk { * * @category Core Endpoints */ - config({ capabilities, popoutSize, version, }: ConfigOptions): Promise; + config({ capabilities, popoutSize, size, version, }: ConfigOptions): Promise; /** * * Returns an array of APIs and events supported by the current running context. diff --git a/dist/sdk.es.js b/dist/sdk.es.js index c4ab763..a23e0bf 100644 --- a/dist/sdk.es.js +++ b/dist/sdk.es.js @@ -20,7 +20,7 @@ * SOFTWARE. */ -var version = "0.16.0"; +var version = "0.16.1"; var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || @@ -91,8 +91,8 @@ function __spreadArray(to, from, pack) { return to.concat(ar || Array.prototype.slice.call(from)); } -var ZERO_SIXTEEN_ZERO = '0.16.0'; -var ZERO_FOURTEEN_ZERO = '0.14.0'; +var ZERO_SIXTEEN = '0.16'; +var ZERO_FOURTEEN = '0.14'; function createApplyProxy(targetApi, prop) { return new Proxy(targetApi, { @@ -357,10 +357,10 @@ var helpers = { }, }; -var _a$1, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18; +var _a$1, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17; var mappings = (_a$1 = {}, _a$1[NativeApis.SEND_APP_INVITATION] = (_b = {}, - _b[ZERO_SIXTEEN_ZERO] = { + _b[ZERO_SIXTEEN] = { '0.0.0': { mapInput: renameKeys({ participants: 'user_list', @@ -370,14 +370,17 @@ var mappings = (_a$1 = {}, }, _b), _a$1[NativeApis.TOGGLE_PARTICIPANT_MEDIA_AUDIO] = (_c = {}, - _c[ZERO_SIXTEEN_ZERO] = { + _c[ZERO_SIXTEEN] = { '0.0.0': { mapInput: renameKeys({ participants: 'user_list' }), + mapOutput: function (value) { + return wrapInObject({ key: 'message', value: value }); + }, }, }, _c), _a$1[NativeApis.GET_RUNNING_CONTEXT] = (_d = {}, - _d[ZERO_SIXTEEN_ZERO] = { + _d[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'context', value: value }); @@ -386,21 +389,21 @@ var mappings = (_a$1 = {}, }, _d), _a$1[NativeApis.GET_RUNNING_CONTEXT] = (_e = {}, - _e[ZERO_SIXTEEN_ZERO] = { + _e[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (context) { return ({ context: context }); }, }, }, _e), _a$1[NativeApis.OPEN_URL] = (_f = {}, - _f[ZERO_FOURTEEN_ZERO] = { + _f[ZERO_FOURTEEN] = { '0.0.0': { validate: function (data) { new URL(data.url); }, }, }, - _f[ZERO_SIXTEEN_ZERO] = { + _f[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -412,7 +415,7 @@ var mappings = (_a$1 = {}, }, _f), _a$1[NativeApis.SET_VIRTUAL_BACKGROUND] = (_g = {}, - _g[ZERO_SIXTEEN_ZERO] = { + _g[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -421,7 +424,7 @@ var mappings = (_a$1 = {}, }, _g), _a$1[NativeApis.REMOVE_VIRTUAL_BACKGROUND] = (_h = {}, - _h[ZERO_SIXTEEN_ZERO] = { + _h[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -430,7 +433,7 @@ var mappings = (_a$1 = {}, }, _h), _a$1[NativeApis.SET_VIRTUAL_FOREGROUND] = (_j = {}, - _j[ZERO_SIXTEEN_ZERO] = { + _j[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -439,7 +442,7 @@ var mappings = (_a$1 = {}, }, _j), _a$1[NativeApis.REMOVE_VIRTUAL_FOREGROUND] = (_k = {}, - _k[ZERO_SIXTEEN_ZERO] = { + _k[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -448,7 +451,7 @@ var mappings = (_a$1 = {}, }, _k), _a$1[NativeApis.SHOW_NOTIFICATION] = (_l = {}, - _l[ZERO_SIXTEEN_ZERO] = { + _l[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -457,7 +460,7 @@ var mappings = (_a$1 = {}, }, _l), _a$1[NativeApis.CLOUD_RECORDING] = (_m = {}, - _m[ZERO_SIXTEEN_ZERO] = { + _m[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -466,7 +469,7 @@ var mappings = (_a$1 = {}, }, _m), _a$1[NativeApis.SHARE_APP] = (_o = {}, - _o[ZERO_SIXTEEN_ZERO] = { + _o[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -475,7 +478,7 @@ var mappings = (_a$1 = {}, }, _o), _a$1[NativeApis.SET_CAMERA] = (_p = {}, - _p[ZERO_SIXTEEN_ZERO] = { + _p[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -484,7 +487,7 @@ var mappings = (_a$1 = {}, }, _p), _a$1[NativeApis.SET_VIDEO_MIRROR_EFFECT] = (_q = {}, - _q[ZERO_SIXTEEN_ZERO] = { + _q[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -493,7 +496,7 @@ var mappings = (_a$1 = {}, }, _q), _a$1[NativeApis.EXPAND_APP] = (_r = {}, - _r[ZERO_SIXTEEN_ZERO] = { + _r[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -502,7 +505,7 @@ var mappings = (_a$1 = {}, }, _r), _a$1[NativeApis.CONNECT] = (_s = {}, - _s[ZERO_SIXTEEN_ZERO] = { + _s[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -511,7 +514,7 @@ var mappings = (_a$1 = {}, }, _s), _a$1[NativeApis.POST_MESSAGE] = (_t = {}, - _t[ZERO_SIXTEEN_ZERO] = { + _t[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -520,7 +523,7 @@ var mappings = (_a$1 = {}, }, _t), _a$1[NativeApis.ALLOW_PARTICIPANT_TO_RECORD] = (_u = {}, - _u[ZERO_SIXTEEN_ZERO] = { + _u[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -529,7 +532,7 @@ var mappings = (_a$1 = {}, }, _u), _a$1[NativeApis.LAUNCH_APP_IN_MEETING] = (_v = {}, - _v[ZERO_SIXTEEN_ZERO] = { + _v[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -538,7 +541,7 @@ var mappings = (_a$1 = {}, }, _v), _a$1[NativeApis.SHOW_APP_INVITATION_DIALOG] = (_w = {}, - _w[ZERO_SIXTEEN_ZERO] = { + _w[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -547,7 +550,7 @@ var mappings = (_a$1 = {}, }, _w), _a$1[NativeApis.RUN_RENDERING_CONTEXT] = (_x = {}, - _x[ZERO_SIXTEEN_ZERO] = { + _x[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -556,7 +559,7 @@ var mappings = (_a$1 = {}, }, _x), _a$1[NativeApis.CLOSE_RENDERING_CONTEXT] = (_y = {}, - _y[ZERO_SIXTEEN_ZERO] = { + _y[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -565,7 +568,7 @@ var mappings = (_a$1 = {}, }, _y), _a$1[NativeApis.DRAW_PARTICIPANT] = (_z = {}, - _z[ZERO_SIXTEEN_ZERO] = { + _z[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -574,7 +577,7 @@ var mappings = (_a$1 = {}, }, _z), _a$1[NativeApis.CLEAR_PARTICIPANT] = (_0 = {}, - _0[ZERO_SIXTEEN_ZERO] = { + _0[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -583,7 +586,7 @@ var mappings = (_a$1 = {}, }, _0), _a$1[NativeApis.CLEAR_IMAGE] = (_1 = {}, - _1[ZERO_SIXTEEN_ZERO] = { + _1[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -592,7 +595,7 @@ var mappings = (_a$1 = {}, }, _1), _a$1[NativeApis.DRAW_WEBVIEW] = (_2 = {}, - _2[ZERO_SIXTEEN_ZERO] = { + _2[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -601,7 +604,7 @@ var mappings = (_a$1 = {}, }, _2), _a$1[NativeApis.CLEAR_WEBVIEW] = (_3 = {}, - _3[ZERO_SIXTEEN_ZERO] = { + _3[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -610,7 +613,7 @@ var mappings = (_a$1 = {}, }, _3), _a$1[NativeApis.BREAKOUT_ROOMS_OPEN] = (_4 = {}, - _4[ZERO_SIXTEEN_ZERO] = { + _4[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -619,7 +622,7 @@ var mappings = (_a$1 = {}, }, _4), _a$1[NativeApis.BREAKOUT_ROOMS_CLOSE] = (_5 = {}, - _5[ZERO_SIXTEEN_ZERO] = { + _5[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -628,7 +631,7 @@ var mappings = (_a$1 = {}, }, _5), _a$1[NativeApis.BREAKOUT_ROOM_DELETE] = (_6 = {}, - _6[ZERO_SIXTEEN_ZERO] = { + _6[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -637,7 +640,7 @@ var mappings = (_a$1 = {}, }, _6), _a$1[NativeApis.BREAKOUT_ROOM_RENAME] = (_7 = {}, - _7[ZERO_SIXTEEN_ZERO] = { + _7[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -646,7 +649,7 @@ var mappings = (_a$1 = {}, }, _7), _a$1[NativeApis.BREAKOUT_ROOM_ASSIGN_PARTICIPANT] = (_8 = {}, - _8[ZERO_SIXTEEN_ZERO] = { + _8[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -655,7 +658,7 @@ var mappings = (_a$1 = {}, }, _8), _a$1[NativeApis.BREAKOUT_ROOM_CHANGE] = (_9 = {}, - _9[ZERO_SIXTEEN_ZERO] = { + _9[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -664,7 +667,7 @@ var mappings = (_a$1 = {}, }, _9), _a$1[NativeApis.COLLABORATE_START] = (_10 = {}, - _10[ZERO_SIXTEEN_ZERO] = { + _10[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -673,7 +676,7 @@ var mappings = (_a$1 = {}, }, _10), _a$1[NativeApis.COLLABORATE_END] = (_11 = {}, - _11[ZERO_SIXTEEN_ZERO] = { + _11[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -682,7 +685,7 @@ var mappings = (_a$1 = {}, }, _11), _a$1[NativeApis.COLLABORATE_LEAVE] = (_12 = {}, - _12[ZERO_SIXTEEN_ZERO] = { + _12[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -691,7 +694,7 @@ var mappings = (_a$1 = {}, }, _12), _a$1[NativeApis.COLLABORATE_JOIN] = (_13 = {}, - _13[ZERO_SIXTEEN_ZERO] = { + _13[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -700,7 +703,7 @@ var mappings = (_a$1 = {}, }, _13), _a$1[NativeApis.AUTHORIZE] = (_14 = {}, - _14[ZERO_SIXTEEN_ZERO] = { + _14[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -714,7 +717,7 @@ var mappings = (_a$1 = {}, }, _14), _a$1[NativeApis.PROMPT_AUTHORIZE] = (_15 = {}, - _15[ZERO_SIXTEEN_ZERO] = { + _15[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -723,7 +726,7 @@ var mappings = (_a$1 = {}, }, _15), _a$1[NativeApis.SET_USER_MEDIA_VIDEO] = (_16 = {}, - _16[ZERO_SIXTEEN_ZERO] = { + _16[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -732,7 +735,7 @@ var mappings = (_a$1 = {}, }, _16), _a$1[NativeApis.SET_USER_MEDIA_AUDIO] = (_17 = {}, - _17[ZERO_SIXTEEN_ZERO] = { + _17[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -740,15 +743,6 @@ var mappings = (_a$1 = {}, }, }, _17), - _a$1[NativeApis.TOGGLE_PARTICIPANT_MEDIA_AUDIO] = (_18 = {}, - _18[ZERO_SIXTEEN_ZERO] = { - '0.0.0': { - mapOutput: function (value) { - return wrapInObject({ key: 'message', value: value }); - }, - }, - }, - _18), _a$1); function renameKeys(keyMap) { return function (data) { @@ -775,10 +769,11 @@ function getMappingFunctions(apiName, sdkVersion, clientVersion) { mapOutput: identity, validate: noop, }; + var convertedSdkVersion = convertVersion(sdkVersion); var apiMappings = mappings[apiName]; if (!apiMappings) return fns; - var sdkMappings = apiMappings[sdkVersion]; + var sdkMappings = apiMappings[convertedSdkVersion]; if (!sdkMappings) return fns; var versions = Object.keys(sdkMappings).sort(compareVersions); @@ -818,6 +813,21 @@ function compareVersions(v1, v2) { return 1; return 0; } +function convertVersion(sdkVersion) { + if (typeof sdkVersion !== 'string') { + console.warn('You have not provided a valid sdk version'); + return; + } + var _a = sdkVersion.split('.'), maj = _a[0], min = _a[1]; _a[2]; + switch ("".concat(maj, ".").concat(min)) { + case ZERO_FOURTEEN: + return ZERO_FOURTEEN; + case ZERO_SIXTEEN: + return ZERO_SIXTEEN; + default: + console.warn('You have not provided a valid sdk version'); + } +} var _a; var nativeApiCallbacks = {}; @@ -869,7 +879,7 @@ var ZoomSdk = (function () { nativeApiRequest.data = mapInput(data); } if (apiName === NativeApis.OPEN_URL && - this._version !== ZERO_FOURTEEN_ZERO) { + this._version !== ZERO_FOURTEEN) { this._postMessage(nativeApiRequest); return [2 , { message: 'success' }]; } @@ -897,7 +907,7 @@ var ZoomSdk = (function () { }); }; ZoomSdk.prototype.config = function (_a) { - var capabilities = _a.capabilities, popoutSize = _a.popoutSize, _b = _a.version, version = _b === void 0 ? ZERO_FOURTEEN_ZERO : _b; + var capabilities = _a.capabilities, popoutSize = _a.popoutSize, size = _a.size, _b = _a.version, version = _b === void 0 ? ZERO_FOURTEEN : _b; return __awaiter(this, void 0, void 0, function () { var newOptions, response; var _this = this; @@ -906,12 +916,12 @@ var ZoomSdk = (function () { case 0: newOptions = { js_api_lists: capabilities, - size: popoutSize, + size: popoutSize || size, }; if (!isString(this._version)) { this._version = version; } - if (this._version === ZERO_FOURTEEN_ZERO) { + if (this._version === ZERO_FOURTEEN) { console.warn('You are using an outdated version of the SDK, please update to the latest version.'); } this._postMessage = setPostMessage.call(this); diff --git a/dist/sdk.module.js b/dist/sdk.module.js index 1183a88..5ae3fac 100644 --- a/dist/sdk.module.js +++ b/dist/sdk.module.js @@ -22,7 +22,7 @@ 'use strict'; -var version = "0.16.0"; +var version = "0.16.1"; var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || @@ -93,8 +93,8 @@ function __spreadArray(to, from, pack) { return to.concat(ar || Array.prototype.slice.call(from)); } -var ZERO_SIXTEEN_ZERO = '0.16.0'; -var ZERO_FOURTEEN_ZERO = '0.14.0'; +var ZERO_SIXTEEN = '0.16'; +var ZERO_FOURTEEN = '0.14'; function createApplyProxy(targetApi, prop) { return new Proxy(targetApi, { @@ -359,10 +359,10 @@ var helpers = { }, }; -var _a$1, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18; +var _a$1, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17; var mappings = (_a$1 = {}, _a$1[NativeApis.SEND_APP_INVITATION] = (_b = {}, - _b[ZERO_SIXTEEN_ZERO] = { + _b[ZERO_SIXTEEN] = { '0.0.0': { mapInput: renameKeys({ participants: 'user_list', @@ -372,14 +372,17 @@ var mappings = (_a$1 = {}, }, _b), _a$1[NativeApis.TOGGLE_PARTICIPANT_MEDIA_AUDIO] = (_c = {}, - _c[ZERO_SIXTEEN_ZERO] = { + _c[ZERO_SIXTEEN] = { '0.0.0': { mapInput: renameKeys({ participants: 'user_list' }), + mapOutput: function (value) { + return wrapInObject({ key: 'message', value: value }); + }, }, }, _c), _a$1[NativeApis.GET_RUNNING_CONTEXT] = (_d = {}, - _d[ZERO_SIXTEEN_ZERO] = { + _d[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'context', value: value }); @@ -388,21 +391,21 @@ var mappings = (_a$1 = {}, }, _d), _a$1[NativeApis.GET_RUNNING_CONTEXT] = (_e = {}, - _e[ZERO_SIXTEEN_ZERO] = { + _e[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (context) { return ({ context: context }); }, }, }, _e), _a$1[NativeApis.OPEN_URL] = (_f = {}, - _f[ZERO_FOURTEEN_ZERO] = { + _f[ZERO_FOURTEEN] = { '0.0.0': { validate: function (data) { new URL(data.url); }, }, }, - _f[ZERO_SIXTEEN_ZERO] = { + _f[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -414,7 +417,7 @@ var mappings = (_a$1 = {}, }, _f), _a$1[NativeApis.SET_VIRTUAL_BACKGROUND] = (_g = {}, - _g[ZERO_SIXTEEN_ZERO] = { + _g[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -423,7 +426,7 @@ var mappings = (_a$1 = {}, }, _g), _a$1[NativeApis.REMOVE_VIRTUAL_BACKGROUND] = (_h = {}, - _h[ZERO_SIXTEEN_ZERO] = { + _h[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -432,7 +435,7 @@ var mappings = (_a$1 = {}, }, _h), _a$1[NativeApis.SET_VIRTUAL_FOREGROUND] = (_j = {}, - _j[ZERO_SIXTEEN_ZERO] = { + _j[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -441,7 +444,7 @@ var mappings = (_a$1 = {}, }, _j), _a$1[NativeApis.REMOVE_VIRTUAL_FOREGROUND] = (_k = {}, - _k[ZERO_SIXTEEN_ZERO] = { + _k[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -450,7 +453,7 @@ var mappings = (_a$1 = {}, }, _k), _a$1[NativeApis.SHOW_NOTIFICATION] = (_l = {}, - _l[ZERO_SIXTEEN_ZERO] = { + _l[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -459,7 +462,7 @@ var mappings = (_a$1 = {}, }, _l), _a$1[NativeApis.CLOUD_RECORDING] = (_m = {}, - _m[ZERO_SIXTEEN_ZERO] = { + _m[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -468,7 +471,7 @@ var mappings = (_a$1 = {}, }, _m), _a$1[NativeApis.SHARE_APP] = (_o = {}, - _o[ZERO_SIXTEEN_ZERO] = { + _o[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -477,7 +480,7 @@ var mappings = (_a$1 = {}, }, _o), _a$1[NativeApis.SET_CAMERA] = (_p = {}, - _p[ZERO_SIXTEEN_ZERO] = { + _p[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -486,7 +489,7 @@ var mappings = (_a$1 = {}, }, _p), _a$1[NativeApis.SET_VIDEO_MIRROR_EFFECT] = (_q = {}, - _q[ZERO_SIXTEEN_ZERO] = { + _q[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -495,7 +498,7 @@ var mappings = (_a$1 = {}, }, _q), _a$1[NativeApis.EXPAND_APP] = (_r = {}, - _r[ZERO_SIXTEEN_ZERO] = { + _r[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -504,7 +507,7 @@ var mappings = (_a$1 = {}, }, _r), _a$1[NativeApis.CONNECT] = (_s = {}, - _s[ZERO_SIXTEEN_ZERO] = { + _s[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -513,7 +516,7 @@ var mappings = (_a$1 = {}, }, _s), _a$1[NativeApis.POST_MESSAGE] = (_t = {}, - _t[ZERO_SIXTEEN_ZERO] = { + _t[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -522,7 +525,7 @@ var mappings = (_a$1 = {}, }, _t), _a$1[NativeApis.ALLOW_PARTICIPANT_TO_RECORD] = (_u = {}, - _u[ZERO_SIXTEEN_ZERO] = { + _u[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -531,7 +534,7 @@ var mappings = (_a$1 = {}, }, _u), _a$1[NativeApis.LAUNCH_APP_IN_MEETING] = (_v = {}, - _v[ZERO_SIXTEEN_ZERO] = { + _v[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -540,7 +543,7 @@ var mappings = (_a$1 = {}, }, _v), _a$1[NativeApis.SHOW_APP_INVITATION_DIALOG] = (_w = {}, - _w[ZERO_SIXTEEN_ZERO] = { + _w[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -549,7 +552,7 @@ var mappings = (_a$1 = {}, }, _w), _a$1[NativeApis.RUN_RENDERING_CONTEXT] = (_x = {}, - _x[ZERO_SIXTEEN_ZERO] = { + _x[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -558,7 +561,7 @@ var mappings = (_a$1 = {}, }, _x), _a$1[NativeApis.CLOSE_RENDERING_CONTEXT] = (_y = {}, - _y[ZERO_SIXTEEN_ZERO] = { + _y[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -567,7 +570,7 @@ var mappings = (_a$1 = {}, }, _y), _a$1[NativeApis.DRAW_PARTICIPANT] = (_z = {}, - _z[ZERO_SIXTEEN_ZERO] = { + _z[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -576,7 +579,7 @@ var mappings = (_a$1 = {}, }, _z), _a$1[NativeApis.CLEAR_PARTICIPANT] = (_0 = {}, - _0[ZERO_SIXTEEN_ZERO] = { + _0[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -585,7 +588,7 @@ var mappings = (_a$1 = {}, }, _0), _a$1[NativeApis.CLEAR_IMAGE] = (_1 = {}, - _1[ZERO_SIXTEEN_ZERO] = { + _1[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -594,7 +597,7 @@ var mappings = (_a$1 = {}, }, _1), _a$1[NativeApis.DRAW_WEBVIEW] = (_2 = {}, - _2[ZERO_SIXTEEN_ZERO] = { + _2[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -603,7 +606,7 @@ var mappings = (_a$1 = {}, }, _2), _a$1[NativeApis.CLEAR_WEBVIEW] = (_3 = {}, - _3[ZERO_SIXTEEN_ZERO] = { + _3[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -612,7 +615,7 @@ var mappings = (_a$1 = {}, }, _3), _a$1[NativeApis.BREAKOUT_ROOMS_OPEN] = (_4 = {}, - _4[ZERO_SIXTEEN_ZERO] = { + _4[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -621,7 +624,7 @@ var mappings = (_a$1 = {}, }, _4), _a$1[NativeApis.BREAKOUT_ROOMS_CLOSE] = (_5 = {}, - _5[ZERO_SIXTEEN_ZERO] = { + _5[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -630,7 +633,7 @@ var mappings = (_a$1 = {}, }, _5), _a$1[NativeApis.BREAKOUT_ROOM_DELETE] = (_6 = {}, - _6[ZERO_SIXTEEN_ZERO] = { + _6[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -639,7 +642,7 @@ var mappings = (_a$1 = {}, }, _6), _a$1[NativeApis.BREAKOUT_ROOM_RENAME] = (_7 = {}, - _7[ZERO_SIXTEEN_ZERO] = { + _7[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -648,7 +651,7 @@ var mappings = (_a$1 = {}, }, _7), _a$1[NativeApis.BREAKOUT_ROOM_ASSIGN_PARTICIPANT] = (_8 = {}, - _8[ZERO_SIXTEEN_ZERO] = { + _8[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -657,7 +660,7 @@ var mappings = (_a$1 = {}, }, _8), _a$1[NativeApis.BREAKOUT_ROOM_CHANGE] = (_9 = {}, - _9[ZERO_SIXTEEN_ZERO] = { + _9[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -666,7 +669,7 @@ var mappings = (_a$1 = {}, }, _9), _a$1[NativeApis.COLLABORATE_START] = (_10 = {}, - _10[ZERO_SIXTEEN_ZERO] = { + _10[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -675,7 +678,7 @@ var mappings = (_a$1 = {}, }, _10), _a$1[NativeApis.COLLABORATE_END] = (_11 = {}, - _11[ZERO_SIXTEEN_ZERO] = { + _11[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -684,7 +687,7 @@ var mappings = (_a$1 = {}, }, _11), _a$1[NativeApis.COLLABORATE_LEAVE] = (_12 = {}, - _12[ZERO_SIXTEEN_ZERO] = { + _12[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -693,7 +696,7 @@ var mappings = (_a$1 = {}, }, _12), _a$1[NativeApis.COLLABORATE_JOIN] = (_13 = {}, - _13[ZERO_SIXTEEN_ZERO] = { + _13[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -702,7 +705,7 @@ var mappings = (_a$1 = {}, }, _13), _a$1[NativeApis.AUTHORIZE] = (_14 = {}, - _14[ZERO_SIXTEEN_ZERO] = { + _14[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -716,7 +719,7 @@ var mappings = (_a$1 = {}, }, _14), _a$1[NativeApis.PROMPT_AUTHORIZE] = (_15 = {}, - _15[ZERO_SIXTEEN_ZERO] = { + _15[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -725,7 +728,7 @@ var mappings = (_a$1 = {}, }, _15), _a$1[NativeApis.SET_USER_MEDIA_VIDEO] = (_16 = {}, - _16[ZERO_SIXTEEN_ZERO] = { + _16[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -734,7 +737,7 @@ var mappings = (_a$1 = {}, }, _16), _a$1[NativeApis.SET_USER_MEDIA_AUDIO] = (_17 = {}, - _17[ZERO_SIXTEEN_ZERO] = { + _17[ZERO_SIXTEEN] = { '0.0.0': { mapOutput: function (value) { return wrapInObject({ key: 'message', value: value }); @@ -742,15 +745,6 @@ var mappings = (_a$1 = {}, }, }, _17), - _a$1[NativeApis.TOGGLE_PARTICIPANT_MEDIA_AUDIO] = (_18 = {}, - _18[ZERO_SIXTEEN_ZERO] = { - '0.0.0': { - mapOutput: function (value) { - return wrapInObject({ key: 'message', value: value }); - }, - }, - }, - _18), _a$1); function renameKeys(keyMap) { return function (data) { @@ -777,10 +771,11 @@ function getMappingFunctions(apiName, sdkVersion, clientVersion) { mapOutput: identity, validate: noop, }; + var convertedSdkVersion = convertVersion(sdkVersion); var apiMappings = mappings[apiName]; if (!apiMappings) return fns; - var sdkMappings = apiMappings[sdkVersion]; + var sdkMappings = apiMappings[convertedSdkVersion]; if (!sdkMappings) return fns; var versions = Object.keys(sdkMappings).sort(compareVersions); @@ -820,6 +815,21 @@ function compareVersions(v1, v2) { return 1; return 0; } +function convertVersion(sdkVersion) { + if (typeof sdkVersion !== 'string') { + console.warn('You have not provided a valid sdk version'); + return; + } + var _a = sdkVersion.split('.'), maj = _a[0], min = _a[1]; _a[2]; + switch ("".concat(maj, ".").concat(min)) { + case ZERO_FOURTEEN: + return ZERO_FOURTEEN; + case ZERO_SIXTEEN: + return ZERO_SIXTEEN; + default: + console.warn('You have not provided a valid sdk version'); + } +} var _a; var nativeApiCallbacks = {}; @@ -871,7 +881,7 @@ var ZoomSdk = (function () { nativeApiRequest.data = mapInput(data); } if (apiName === NativeApis.OPEN_URL && - this._version !== ZERO_FOURTEEN_ZERO) { + this._version !== ZERO_FOURTEEN) { this._postMessage(nativeApiRequest); return [2 , { message: 'success' }]; } @@ -899,7 +909,7 @@ var ZoomSdk = (function () { }); }; ZoomSdk.prototype.config = function (_a) { - var capabilities = _a.capabilities, popoutSize = _a.popoutSize, _b = _a.version, version = _b === void 0 ? ZERO_FOURTEEN_ZERO : _b; + var capabilities = _a.capabilities, popoutSize = _a.popoutSize, size = _a.size, _b = _a.version, version = _b === void 0 ? ZERO_FOURTEEN : _b; return __awaiter(this, void 0, void 0, function () { var newOptions, response; var _this = this; @@ -908,12 +918,12 @@ var ZoomSdk = (function () { case 0: newOptions = { js_api_lists: capabilities, - size: popoutSize, + size: popoutSize || size, }; if (!isString(this._version)) { this._version = version; } - if (this._version === ZERO_FOURTEEN_ZERO) { + if (this._version === ZERO_FOURTEEN) { console.warn('You are using an outdated version of the SDK, please update to the latest version.'); } this._postMessage = setPostMessage.call(this); diff --git a/package.json b/package.json index 47f7c0a..a6ce056 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zoom/appssdk", - "version": "0.16.0", + "version": "0.16.1", "description": "Zoom Apps SDK", "license": "MIT", "files": [ @@ -53,8 +53,6 @@ "jest-canvas-mock": "^2.4.0", "jest-environment-jsdom": "^28.1.1", "lint-staged": "^12.4.1", - "live-server": "^1.1.0", - "onchange": "^7.1.0", "prettier": "^2.2.1", "rollup": "^2.34.0", "rollup-plugin-cleanup": "^3.2.1",