-
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 'main' into jadahiya/edge_fix
- Loading branch information
Showing
45 changed files
with
1,926 additions
and
366 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
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
7 changes: 7 additions & 0 deletions
7
change/@microsoft-teams-js-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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"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-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" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@microsoft-teams-js-81b620f2-8af1-4450-89b0-20600bac843e.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": "patch", | ||
"comment": "Updated internal app id validation", | ||
"packageName": "@microsoft/teams-js", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@microsoft-teams-js-87505803-bfad-44bd-a44d-f2ba244c46ad.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 a Rollup built bundle of Teams-JS", | ||
"packageName": "@microsoft/teams-js", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@microsoft-teams-js-9226f943-a345-4cef-95fe-607b0df82934.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": "none", | ||
"comment": "Renamed prepBetaRelease.js to use .cjs file extension", | ||
"packageName": "@microsoft/teams-js", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@microsoft-teams-js-b1e62451-f7ad-44d0-b700-d5fe996761f9.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 logging for current teamsjs instance and timestamps", | ||
"packageName": "@microsoft/teams-js", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
Oops, something went wrong.