-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add client libraries for Azure Communication Services (#11385)
- Loading branch information
Showing
220 changed files
with
13,617 additions
and
12 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
18 changes: 18 additions & 0 deletions
18
sdk/communication/communication-administration/.eslintrc.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,18 @@ | ||
{ | ||
"plugins": ["@azure/azure-sdk"], | ||
"extends": ["plugin:@azure/azure-sdk/azure-sdk-base"], | ||
"rules": { | ||
"@azure/azure-sdk/ts-naming-options": "off" | ||
// "@azure/azure-sdk/ts-config-declaration": "off", | ||
// "@azure/azure-sdk/ts-config-allowsyntheticdefaultimports": "off", | ||
// "@azure/azure-sdk/ts-config-esmoduleinterop": "off", | ||
// "@azure/azure-sdk/ts-config-forceconsistentcasinginfilenames": "off", | ||
// "@azure/azure-sdk/ts-config-importhelpers": "off", | ||
// "@azure/azure-sdk/ts-config-module": "off", | ||
// "@azure/azure-sdk/ts-config-moduleresolution": "off", | ||
// "@azure/azure-sdk/ts-config-sourcemap": "off", | ||
// "@azure/azure-sdk/ts-config-strict": "off", | ||
// "@azure/azure-sdk/ts-config-target": "off", | ||
// "@azure/azure-sdk/ts-config-lib": "off" | ||
} | ||
} |
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,2 @@ | ||
/**/code-model-v* | ||
/docGen |
42 changes: 42 additions & 0 deletions
42
sdk/communication/communication-administration/.vscode/launch.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,42 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug Mocha Test [Without Rollup]", | ||
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", | ||
"args": [ | ||
"-r", | ||
"ts-node/register", | ||
"--timeout", | ||
"999999", | ||
"--colors", | ||
"${workspaceFolder}/test/*.spec.ts" | ||
], | ||
"env": { "TS_NODE_COMPILER_OPTIONS": "{\"module\": \"commonjs\"}" }, | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
"protocol": "inspector" | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug Unit Tests", | ||
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", | ||
"args": [ | ||
"-u", | ||
"tdd", | ||
"--timeout", | ||
"999999", | ||
"--colors", | ||
"${workspaceFolder}/dist-test/index.node.js" | ||
], | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"preLaunchTask": "npm: build:test" | ||
} | ||
] | ||
} |
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 @@ | ||
# Release History | ||
|
||
## 1.0.0-beta.1 (2020-09-22) | ||
|
||
The Azure Communication Administration Client library contains code which facilitates user token administration. |
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2020 Microsoft | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,83 @@ | ||
# Azure Communication Administration client library for JavaScript | ||
|
||
The Azure Communication Administration library lets the developer create/delete users and issue tokens for Communication Services. Users and tokens can then be used when adding Chat or Calling to an app. | ||
|
||
## Getting started | ||
|
||
### Prerequisites | ||
|
||
- An [Azure subscription][azure_sub]. | ||
- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. | ||
|
||
### Installing | ||
|
||
```bash | ||
npm install @azure/communication-administration | ||
``` | ||
|
||
## Key concepts | ||
|
||
### CommunicationIdentityClient | ||
|
||
`CommunicationIdentityClient` provides methods to manage users and their tokens. | ||
|
||
## Examples | ||
|
||
## Authentication | ||
|
||
You can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you may authenticate with any of the following methods: | ||
|
||
### Create `KeyCredential` with `AzureKeyCredential` before initializing CommunicationIdentityClient | ||
|
||
```typescript | ||
import { AzureKeyCredential } from "@azure/core-auth"; | ||
import { CommunicationIdentityClient } from "@azure/communication-administration"; | ||
|
||
const credential = new AzureKeyCredential(KEY); | ||
const client = new CommunicationIdentityClient(HOST, credential); | ||
``` | ||
|
||
### Using a connection string | ||
|
||
```typescript | ||
import { CommunicationIdentityClient } from "@azure/communication-administration"; | ||
|
||
const connectionString = `endpoint=HOST;accessKey=KEY`; | ||
const client = new CommunicationIdentityClient(connectionString); | ||
``` | ||
|
||
## Usage | ||
|
||
### Create a user and token | ||
|
||
Here we create an instance of the `CommunicationIdentityClient` class, create a user, then issue a chat scoped token for the user. | ||
|
||
```typescript | ||
import { CommunicationIdentityClient } from "@azure/communication-administration"; | ||
|
||
const client = new CommunicationIdentityClient(CONNECTION_STRING); | ||
const user = await client.createUser(); | ||
const { token } = await client.issueToken(user, ["chat"]); | ||
``` | ||
|
||
## Troubleshooting | ||
|
||
## Next steps | ||
|
||
Please take a look at the | ||
[samples]<!--(https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)--> | ||
directory for detailed examples on how to use this library. | ||
|
||
## Contributing | ||
|
||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code. | ||
|
||
## Related projects | ||
|
||
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) | ||
|
||
[azure_cli]: https://docs.microsoft.com/cli/azure | ||
[azure_sub]: https://azure.microsoft.com/free/ | ||
[azure_portal]: https://portal.azure.com | ||
|
||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png) |
35 changes: 35 additions & 0 deletions
35
sdk/communication/communication-administration/api-extractor.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,35 @@ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
"mainEntryPointFilePath": "types/src/index.d.ts", | ||
"docModel": { | ||
"enabled": true | ||
}, | ||
"apiReport": { | ||
"enabled": true, | ||
"reportFolder": "./review" | ||
}, | ||
"dtsRollup": { | ||
"enabled": true, | ||
"untrimmedFilePath": "", | ||
"publicTrimmedFilePath": "./types/communication-administration.d.ts" | ||
}, | ||
"messages": { | ||
"tsdocMessageReporting": { | ||
"default": { | ||
"logLevel": "none" | ||
} | ||
}, | ||
"extractorMessageReporting": { | ||
"ae-forgotten-export": { | ||
"logLevel": "error", | ||
"addToApiReportFile": false | ||
}, | ||
"ae-missing-release-tag": { | ||
"logLevel": "none" | ||
}, | ||
"ae-unresolved-link": { | ||
"logLevel": "error" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.