* Added autorest generated files with ci pipeline
* Fix package name and folder
* Updated autorest arguments and version and added tests
* Accepting linter corrections
* Added evaluation tests and sample code for champion scenario
* Added champion scenarios
* Generate sample code
* Fix isUnexpected function by adjust the autorest generated code manually.
Separate issue was filed to fix the issue in autorest.js project.
* Updated to use swagger file that has readonly attributes.
* Fixing bugs in test code
* Addressing feedback comments in PR.
* Added test records.
* Added autorest generated files with ci pipeline
* Fix package name and folder
* Updated autorest arguments and version and added tests
* Accepting linter corrections
* Added evaluation tests and sample code for champion scenario
* Added champion scenarios
* Generate sample code
* Fix isUnexpected function by adjust the autorest generated code manually.
Separate issue was filed to fix the issue in autorest.js project.
* Updated to use swagger file that has readonly attributes.
* Fixing bugs in test code
* Addressing feedback comments in PR.
* Added test records.
* Adding session records for multislot tests.
* Accepting changes made to lock file after rush update.
* fix browser tests - reasonable updates to personalizer tests and package.json
* Fixed issue with creating session records for browser and added the session record files.
* Reacting to feedback in comments.
* Added tests to use aad authentication.
* Fix lint and formatting.
* Addressing feedback.
* Replaced functions with constants in sample code.
* Regenerated samples code from samples-dev folder.
* Remove link to github locations that wont work because the PR is not yet merged.
* fix browser tests
* Added test record for aad authn test and igored links to samples to get pipelines to pass.
* Replacing with generic links to fix pipeline failures.
Co-authored-by: Harsha Nalluru <sanallur@microsoft.com>
Previously our `build:samples` script would modify samples to import from
source. However, newer sample workflow no longer does this, and the
`build:samples` script now just "echo Obsolete".
This PR removes tests that guard against committing unwanted sample changes.
* Post release automated changes for azure-core-util
* Post release automated changes for azure-core-http
* Post release automated changes for azure-core-rest-pipeline
* Post release automated changes for azure-core-amqp
* [test][search-document] address missing test issue
It appears that dev-tool doesn't receive the wrapping quotes around glob pattern
on Linux/MacOS, which prevents Mocha from handle the pattern correctly.
This PR adds the quotes when the argument is a glob pattern that contains "**"
so that expansion can be done by Mocha.
* Don't mutate the original options
# Fixing LRO cancellation by deprecating `cancelOperation`
Canceling a long-running operation is currently done by calling `cancelOperation`: eb0aa1da67/sdk/core/core-lro/src/poller.ts (L79-L82) However the cancellation behavior could vary between APIs in a way that makes `cancelOperation` a confusing abstraction. In particular, when sending a cancellation request, the service may respond with either a 200 or a 202 response, depending on the API and/or the operation, where the former indicates the operation has been canceled immediately and the latter indicates it could be some time before the operation is deemed as canceled. Handling 202 responses needs care to set the customer's expectation about wait times and this is typically done by providing a poller object that customer could use to optionally block until the operation finishes. This discrepancy in behavior makes `cancelOperation` not a suitable abstraction for the case when cancellation returns a 202 response.
In this PR, I am deprecating `cancelOperation` and leaving it up to the library author to implement operation cancellation as they see fit. This proposal has been discussed with @bterlson, @joheredi, and @witemple-msft and they're all on-board with it.
## Pollers without cancellation abstraction
The PR also introduces a second poller interface that doesn't have `cancelOperation` at all, named `SimplePollerLike`. This interface is meant to be used for pollers for new operations that don't support cancellation.
The other difference between `PollerLike` and `SimplePollerLike` is in how the operation state is defined. `PollerLike` defines its state shape as a type that extends `PollOperationState<TResult>`: eb0aa1da67/sdk/core/core-lro/src/pollOperation.ts (L17-L38) Mainly, it has `isStarted`, `isCanceled`, and `isCompleted` booleans. However, the semantics of `isCanceled` can be confusing; should it be set at the time when the cancellation request is sent or when the service responds that the operation is canceled?
To avoid this confusion, `OperationState` replaces those booleans with a status field typed as a union of states:
```ts
export interface OperationState<TResult> {
/**
* The current status of the operation.
*/
status: "notStarted" | "running" | "succeeded" | "canceling" | "canceled" | "failed";
/**
* Will exist if the operation encountered any error.
*/
error?: Error;
/**
* Will exist if the operation produced a result of the expected type.
*/
result?: TResult;
}
```
Which makes it clear that it reflects operation status after each poll.
## Use case: Implement LRO cancellation in @azure/ai-language-text (https://github.com/Azure/azure-sdk-for-js/pull/22852)
The proposal is implemented in a different PR: https://github.com/Azure/azure-sdk-for-js/pull/22852
This LRO cancellation returns a 202 response so cancellation itself is an LRO. I am proposing to implement cancellation by returning a function named `sendCancellationRequest` alongside the operation poller, so the return type is:
```ts
interface AnalyzeBatchOperation {
poller: AnalyzeBatchPoller;
sendCancellationRequest(): Promise<void>;
}
```
And client code can simply destruct the output object as follows to get access to the poller and the cancellation function:
```ts
const { poller, sendCancellationRequest } = await client.beginAnalyzeBatch(actions, documents, "en");
...
// Let's cancel the operation
await sendCancellationRequest(); // poller.cancelOperation() no longer exists
```
Design considerations:
- cancellation as a concept is not related to polling so a poller is not the right place to send cancellation requests
- canceling an operation requires knowing the operation ID/location, but we shouldn't ask customers for that information because it is an implementation detail
- cancellation is an LRO but it doesn't have its own operation location, i.e. the operation location is the same for the operation being cancelled and the cancellation operation itself. This means there is no need to create a dedicated poller for the cancellation operation and customers could still use the existing poller to await their operation or its cancellation
- cancellation is a POST request with no interesting response, so it should be modeled programmatically as `(): Promise<void>` function
- Bump core-util minor version
- Update CHANGELOG files
- Update packages that depends on the particular change in this version.
- Remove -beta.1 as we already GA @azure/core-util.
* [dev-tool] react to typing changes in rollup v2.78
Previously the type for `load` is `any`. Now it can also be a object
```
type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
```
This PR adds type narrowing to fix TypeScript build error.
* bump rollup version
* new test
* fix sending large messages
* formatting and docs
* format
* changelog
* more docs
* Update sdk/servicebus/service-bus/CHANGELOG.md
Co-authored-by: Jeremy Meng <yumeng@microsoft.com>
* Update sdk/servicebus/service-bus/test/internal/sendBatch.spec.ts
* Apply suggestions from code review
* fix error message
Co-authored-by: Jeremy Meng <yumeng@microsoft.com>
* Pass js sdk pipeline ci (#18888)
* Initial commit of job router sdk
* Fix code (Todo: createSpan needs to add to client)
* add api review file
* update pnpm yaml
* skip samples for now
* add readme
* fix lint errors
* fix lint errors
* fix lint errors
* add recordings
* add recordings missing content
* add recordings missing content - browser mode
* remove assert
* Update sdk/communication/communication-job-router/README.md
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/README.md
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/README.md
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/README.md
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/README.md
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/README.md
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/README.md
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/README.md
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/README.md
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/src/routerClient.ts
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Update sdk/communication/communication-job-router/src/routerClient.ts
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* update README.md
* update README.md
Co-authored-by: Marc Ma <marcma@microsoft.com>
Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
* Latest API & Swagger (Update post patch routes, etc) (#19953)
* update to latest patch routes and models
* minor fix
* update routerClient
* update according to feedback
run autorest on latest swagger
* minor updaate
Co-authored-by: Marc Ma <marcma@microsoft.com>
* rev 1 (#22096)
Co-authored-by: Marc Ma <marcma@microsoft.com>
* address required/options params feedback (#22245)
update to latest swagger
clean up tests
Co-authored-by: Marc Ma <marcma@microsoft.com>
* expose models (#22331)
* expose link models
* add api file
expose models
Co-authored-by: Marc Ma <marcma@microsoft.com>
* Add samples for js sdk (#22444)
* Add samples-dev
Generate samples from samples-dev
Adjust route params with public review swagger
* Update options and routerClient
Co-authored-by: Marc Ma <marcma@microsoft.com>
* Public feedback and new api version (#22793)
* Add jobRouterAdministration.ts
New swagger with new api version
* Update samples and api version number
Remove requests.ts
* Update shrinkwrap file
Co-authored-by: Marc Ma <marcma@microsoft.com>
* Rename to jobrouter
* Rename in docs
* Resolve lint errors
* Remove samples readme temporarily
Remove empty options
* Remove beta tag
Update connection string name
* Update test node recordings
* Fix lint and tests
* Run check-format (prettier)
* Update to test-recorder v2
* Update communication packages version to v2
* Resolve conflicts
* Update Readme
Resolve lint
* Update version number
* Fix tests in node mode
TOOD: fix tests in browser mode
* Update according to feedbacks
* Update import
Update pnpm lock
* Update samples
* Update api file
* Fix api file
* Add a missing route
* fields renaming
sample-dev update
* Add paths for the package
* Add todos and issue links
Update readme
Update some recordings
* Update tests
* Prettier
* headerless matcher
* rename the package folder
* update package name in files
Co-authored-by: Marc Ma <marcma@microsoft.com>
The dev-tool runs nyc for integration tests. However, without proper reporter
configurations, desired code coverage reports are not generated.
This PR adds the .nycrc file that is copied from the template project thus
enables code coverage report generation.
### Packages impacted by this PR
@azure/api-management-custom-widgets-scaffolder
### Issues associated with this PR
n/a
### Describe the problem that is addressed by this PR
Update the CLI of the scaffolder package to make it more intuitive
### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
n/a
### Are there test cases added in this PR? _(If not, why?)_
No, there were no changes to the API, only minor improvements to existing templates.
### Provide a list of related PRs _(if any)_
n/a
### Packages impacted by this PR
@azure/api-management-custom-widgets-scaffolder
### Issues associated with this PR
n/a
### Describe the problem that is addressed by this PR
Updates & synchronizes dependencies used in various templates.
Improves formatting in the templates.
Removes unnecessary duplicated path from fetch requests in templates.
### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
n/a
### Are there test cases added in this PR? _(If not, why?)_
No, there were no changes to the API, only minor improvements to existing templates.
### Provide a list of related PRs _(if any)_
n/a