Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat Samples v2 Migration #15317

Merged
merged 4 commits into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions sdk/communication/communication-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@
"build:autorest": "autorest ./swagger/README.md --typescript --version=3.0.6267 --v3 --package-version=1.1.0-beta.1 && rushx format",
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
"build:samples": "dev-tool samples prep && cd dist-samples && tsc -p .",
"build:samples": "echo Obsolete.",
"build:test": "tsc -p . && rollup -c rollup.test.config.js 2>&1",
"build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-* temp types *.tgz *.log",
"execute:samples": "npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples",
"execute:js-samples": "dev-tool samples run dist-samples/javascript",
"execute:ts-samples": "dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/",
"execute:samples": "dev-tool samples run samples-dev",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 dist-esm/test/public/*.spec.js dist-esm/test/public/node/*.spec.js",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
Expand Down Expand Up @@ -125,5 +123,20 @@
"typescript": "~4.2.0",
"util": "^0.12.1",
"typedoc": "0.15.2"
},
"//sampleConfiguration": {
"productName": "Azure Communication Services - Chat",
"productSlugs": [
"azure",
"azure-communication-services"
],
"requiredResources": {
"Azure Communication Services account": "https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource"
},
"skip": [
"threadOperations.js",
"messageOperations.js",
"participantsOperations.js"
0rland0Wats0n marked this conversation as resolved.
Show resolved Hide resolved
]
}
}
9 changes: 3 additions & 6 deletions sdk/communication/communication-chat/sample.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Used in most samples. Retrieve these values from a Communication Services instance
# Used in most samples. Retrieve these values from a Communication Services resource
# in the Azure Portal.
COMMUNICATION_CONNECTION_STRING=""

# Our tests assume that TEST_MODE is "playback" by default. You can
# change it to "record" to generate new recordings, or "live" to bypass the recorder entirely.
# TEST_MODE=record
COMMUNICATION_CONNECTION_STRING="endpoint=https://<resource name>.communication.azure.net/;accessKey=<key>"
COMMUNICATION_ENDPOINT="https://<resource name>.communication.azure.com"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* Demonstrates how to use the ChatThreadClient to do message operations
* @summary Demonstrates how to use the ChatThreadClient to do message operations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @summary Demonstrates how to use the ChatThreadClient to do message operations
* @summary Perform message thread operations using the ChatThreadClient.

*/

import { ChatClient } from "@azure/communication-chat";
Expand Down Expand Up @@ -58,8 +58,7 @@ export async function main() {
console.log("Deleted message.");
}

main().catch((err) => {
console.log("error code: ", err.code);
console.log("error message: ", err.message);
console.log("error stack: ", err.stack);
main().catch((error) => {
console.error("Encountered an error in message operations: ", error);
process.exit(1);
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* Demonstrates how to use the ChatThreadClient to do participant operations
* @summary Demonstrates how to use the ChatThreadClient to do participant operations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @summary Demonstrates how to use the ChatThreadClient to do participant operations
* @summary Add, list and remove participants from a ChatClient using the ChatThreadClient.

*/

import { ChatClient } from "@azure/communication-chat";
Expand Down Expand Up @@ -73,8 +73,7 @@ export async function main() {
console.log("Removed chat participant user.");
}

main().catch((err) => {
console.log("error code: ", err.code);
console.log("error message: ", err.message);
console.log("error stack: ", err.stack);
main().catch((error) => {
console.error("Encountered an error in participants operations: ", error);
process.exit(1);
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

/**
* Demonstrates how to use the ChatClient to do thread operations
* @summary Demonstrates how to use the ChatClient to do thread operations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @summary Demonstrates how to use the ChatClient to do thread operations
* @summary Perform thread operations using the ChatClient.

*/

import { ChatClient } from "@azure/communication-chat";
Expand Down Expand Up @@ -68,8 +68,7 @@ export async function main() {
await chatClient.deleteChatThread(threadId);
}

main().catch((err) => {
console.log("error code: ", err.code);
console.log("error message: ", err.message);
console.log("error stack: ", err.stack);
main().catch((error) => {
console.error("Encountered an error in thread operations: ", error);
process.exit(1);
});
62 changes: 0 additions & 62 deletions sdk/communication/communication-chat/samples/javascript/README.md

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions sdk/communication/communication-chat/samples/tsconfig.json

This file was deleted.

68 changes: 0 additions & 68 deletions sdk/communication/communication-chat/samples/typescript/README.md

This file was deleted.

This file was deleted.

Loading