-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'johnsle/update_caller_interface' of https://github.com/…
…OfficeDev/microsoft-teams-library-js into johnsle/update_caller_interface
- Loading branch information
Showing
71 changed files
with
2,335 additions
and
660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"sdk": { | ||
"version": ">=7.0.14" | ||
"version": ">=8.0.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
apps/teams-test-app/src/components/privateApis/ExternalAppCardActionsForCEAAPIs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { AppId, externalAppCardActionsForCEA, IAdaptiveCardActionSubmit } from '@microsoft/teams-js'; | ||
import React from 'react'; | ||
|
||
import { ApiWithoutInput, ApiWithTextInput } from '../utils'; | ||
import { ModuleWrapper } from '../utils/ModuleWrapper'; | ||
|
||
const CheckExternalAppCardActionsForCEACapability = (): React.ReactElement => | ||
ApiWithoutInput({ | ||
name: 'checkExternalAppCardActionsForCEACapability', | ||
title: 'Check External App Card Actions For CEA Capability', | ||
onClick: async () => | ||
`External App Card Actions For CEA module ${ | ||
externalAppCardActionsForCEA.isSupported() ? 'is' : 'is not' | ||
} supported`, | ||
}); | ||
|
||
const CECProcessActionSubmit = (): React.ReactElement => | ||
ApiWithTextInput<{ | ||
appId: AppId; | ||
conversationId: string; | ||
actionSubmitPayload: IAdaptiveCardActionSubmit; | ||
}>({ | ||
name: 'processActionSubmitForCEA', | ||
title: 'Process Action Submit For CEA', | ||
onClick: { | ||
validateInput: (input) => { | ||
if (!input.appId) { | ||
throw new Error('appId is required'); | ||
} | ||
if (!input.actionSubmitPayload) { | ||
throw new Error('actionSubmitPayload is required'); | ||
} | ||
}, | ||
submit: async (input) => { | ||
await externalAppCardActionsForCEA.processActionSubmit( | ||
input.appId, | ||
input.conversationId, | ||
input.actionSubmitPayload, | ||
); | ||
return 'Completed'; | ||
}, | ||
}, | ||
defaultInput: JSON.stringify({ | ||
appId: 'b7f8c0a0-6c1d-4a9a-9c0a-2c3f1c0a3b0a', | ||
actionSubmitPayload: { | ||
id: 'submitId', | ||
data: 'data1', | ||
}, | ||
}), | ||
}); | ||
|
||
const CECProcessActionOpenUrl = (): React.ReactElement => | ||
ApiWithTextInput<{ | ||
appId: AppId; | ||
conversationId: string; | ||
url: string; | ||
}>({ | ||
name: 'processActionOpenUrlForCEA', | ||
title: 'Process Action Open Url For CEA', | ||
onClick: { | ||
validateInput: (input) => { | ||
if (!input.appId) { | ||
throw new Error('appId is required'); | ||
} | ||
if (!input.url) { | ||
throw new Error('url is required'); | ||
} | ||
}, | ||
submit: async (input) => { | ||
const result = await externalAppCardActionsForCEA.processActionOpenUrl( | ||
input.appId, | ||
input.conversationId, | ||
new URL(input.url), | ||
); | ||
return JSON.stringify(result); | ||
}, | ||
}, | ||
defaultInput: JSON.stringify({ | ||
appId: 'b7f8c0a0-6c1d-4a9a-9c0a-2c3f1c0a3b0a', | ||
url: 'https://www.example.com', | ||
}), | ||
}); | ||
|
||
const ExternalAppCardActionsForCEAAPIs = (): React.ReactElement => ( | ||
<ModuleWrapper title="External App Card Actions For CEA"> | ||
<CheckExternalAppCardActionsForCEACapability /> | ||
<CECProcessActionSubmit /> | ||
<CECProcessActionOpenUrl /> | ||
</ModuleWrapper> | ||
); | ||
|
||
export default ExternalAppCardActionsForCEAAPIs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "tree-shaking-test-app", | ||
"private": true, | ||
"author": "Noah", | ||
"description": "Test app to test the tree-shakability of TeamsJS", | ||
"version": "0.0.1", | ||
"main": "index.ts", | ||
"type": "module", | ||
"scripts": { | ||
"build-rollup": "pnpm clean && rollup --c", | ||
"build-webpack": "webpack", | ||
"clean": "rimraf ./dist" | ||
}, | ||
"dependencies": { | ||
"@microsoft/teams-js": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-typescript": "^11.1.6", | ||
"@rollup/plugin-terser": "0.4.4", | ||
"rollup": "^4.18.0", | ||
"webpack": "^5.18.0", | ||
"webpack-cli": "^4.3.1", | ||
"testlibraryfortreeshaking": "^1.0.24" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import terser from '@rollup/plugin-terser'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
|
||
// rollup.config.mjs | ||
export default { | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
file: 'dist/bundle.js', | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: 'dist/bundle.min.js', | ||
format: 'es', | ||
plugins: [terser()], | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
nodeResolve({ | ||
extension: ['.js', '.ts', '.d.ts', '.json'], | ||
}), | ||
typescript(), | ||
], | ||
treeshake: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { barCode } from 'testlibraryfortreeshaking'; | ||
import { geoLocation } from '@microsoft/teams-js'; | ||
barCode.hasPermission(); | ||
geoLocation.requestPermission(); | ||
geoLocation.map.isSupported(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"allowSyntheticDefaultImports": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"module": "es6", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"jsx": "react", | ||
"sourceMap": true, | ||
"outDir": "./dist" | ||
}, | ||
"include": ["src"], | ||
"exclude": [ | ||
"**/build/*", | ||
"build", | ||
"node_modules", | ||
"**/*.test.*", | ||
"webpack.config.js", | ||
"webpack.cdn.config.js", | ||
"webpack.cdnV1.config.js", | ||
"webpack.local.config.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint @typescript-eslint/no-var-requires: off*/ | ||
/* eslint-disable no-undef */ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
entry: './src/index.ts', | ||
output: { | ||
filename: 'index.js', | ||
path: path.resolve(__dirname, 'dist'), | ||
}, | ||
mode: 'development', | ||
optimization: { | ||
usedExports: true, | ||
innerGraph: true, | ||
sideEffects: false, | ||
}, | ||
devtool: false, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
use: 'ts-loader', | ||
exclude: /node_modules/, | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.tsx', '.ts', '.js'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c4732925-47c0-4279-aa4f-0ef18f84e7e9.json → ...120060c9-a050-4da3-a0a5-2323e3a78d10.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Added new `AppId` class to use as a type where app ids are being stored", | ||
"comment": "Added logging for version on startup", | ||
"packageName": "@microsoft/teams-js", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
|
7 changes: 7 additions & 0 deletions
7
change/@microsoft-teams-js-3c6d20f0-0715-499f-8835-457526329b67.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Updated `pages.navigateToApp` to now optionally accept a more type-safe input object", | ||
"packageName": "@microsoft/teams-js", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 0 additions & 7 deletions
7
change/@microsoft-teams-js-48fab7bb-bf40-4e94-9ff7-d08b07206e8c.json
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
change/@microsoft-teams-js-75e3c524-ba26-4b6a-b01b-9a1f0e315d91.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Added APIs for `externalAppCardActionsForCEA` capability.", | ||
"packageName": "@microsoft/teams-js", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
Oops, something went wrong.