Skip to content

Commit

Permalink
[communication-short-codes] Migrate to Core v2 (Azure#19043)
Browse files Browse the repository at this point in the history
* changes to migrate http client

* shortcodes-http

* formatting changes

* fixing from pulling

* formatting

* credential changes for http client v2 migration

* adding browser specific utils for auth

* adding linter fixes

* fixing mocked client

* updating policy and sdk version constant

* formatting....

* re-recording node tests

* fixes needed for browser tests

* re-recording tests

* fixing unsupported ES2020 'OptionalChain' syntax

* formatting

* fixing unsupported ES2020 'OptionalChain' syntax on pending sample

* fixing unsupported ES2020 'OptionalChain' syntax

* fixed typo for shortcodes description

* retaking http migration work

* removing unnecessary file

* removing http-core library

* resolving comments

* adding re recorded tests

* resolving comments and re-recording tests

* removing unsupported chainings in samples

* fixing samples for ES2020 unsupported syntax

* formatting

* fixing samples and rerecording tests

* fixing tests to include azure on user agent.

prepared for second beta release.

* fixing error from sms. formatting.

* Update communication-common dependency to 2.0.0

Fix package-name property in autorest configuration

* Reuse auth pipelines from communication-common

Inject XHR client to fix browser tests

* Cleanup no longer needed dependencies

* Lint and format

* Expect `preferredVanityNumbers` in program briefs

* Address PR comments

- Add versioning metadata to package.json
- Update changelog wording
- Import `isNode` from `@azure/test-utils`
- Restore tokenCredential explicit typing

Co-authored-by: Daniel Ortega <[email protected]>
  • Loading branch information
2 people authored and WeiJun428 committed Mar 20, 2022
1 parent 086a09b commit 8b400a1
Show file tree
Hide file tree
Showing 36 changed files with 686 additions and 607 deletions.
9 changes: 3 additions & 6 deletions sdk/communication/communication-short-codes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Release History

## 1.0.0-beta.2 (Unreleased)

## 1.0.0-beta.2 (2022-02-08)
### Features Added
- Migrated from using `@azure/core-http` to `@azure/core-rest-pipeline` for the handling of HTTP requests. See [Azure Core v1 vs v2](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/documentation/core2.md) for more on the difference and benefits of the move.

### Breaking Changes

### Bugs Fixed

### Other Changes
- `ShortCodesClient.submitUSProgramBrief` no longer returns the generic `RestResponse` type, and instead returns the more specific `USProgramBrief`. Because of this, the `_response` property is no longer exposed in the returned object. However, in the operation options, it can take a callback (`onResponse`) to access the HTTP response. See https://github.com/Azure/autorest.typescript/wiki/%60core-http%60-dependency-migration-to-%60core-client%60-%60core-rest-pipeline%60#change-to-the-_response-property

## 1.0.0-beta.1 (2021-11-05)

Expand Down
23 changes: 20 additions & 3 deletions sdk/communication/communication-short-codes/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@azure-tools/communication-short-codes",
"version": "1.0.0-beta.2",
"description": "SDK for Azure Communication Services which facilitates short code management.\"",
"description": "SDK for Azure Communication Services which facilitates short code management.",
"sdk-type": "client",
"main": "dist/index.js",
"module": "dist-esm/src/index.js",
Expand Down Expand Up @@ -59,12 +59,13 @@
"sideEffects": false,
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"dependencies": {
"@azure/communication-common": "^1.1.0",
"@azure/abort-controller": "^1.0.0",
"@azure/communication-common": "^2.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-http": "^2.0.0",
"@azure/core-client": "^1.3.2",
"@azure/core-lro": "^2.2.0",
"@azure/core-paging": "^1.1.1",
"@azure/core-rest-pipeline": "^1.3.2",
"@azure/core-tracing": "1.0.0-preview.13",
"@azure/logger": "^1.0.0",
"events": "^3.0.0",
Expand Down Expand Up @@ -107,6 +108,22 @@
"sinon": "^9.0.2",
"typescript": "~4.2.0"
},
"//metadata": {
"constantPaths": [
{
"path": "src/generated/src/shortCodesClientContext.ts",
"prefix": "packageDetails"
},
{
"path": "src/utils/constants.ts",
"prefix": "SDK_VERSION"
},
{
"path": "swagger/README.md",
"prefix": "package-version"
}
]
},
"//sampleConfiguration": {
"productName": "Azure Communication Services - Short Codes",
"productSlugs": [
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8b400a1

Please sign in to comment.