Skip to content

Commit

Permalink
[@Azure/eventgrid] - Azure EventGrid Beta Release V4.13.0-beta.1 (#25906
Browse files Browse the repository at this point in the history
)

### Packages impacted by this PR
@Azure/eventgrid 

### Issues associated with this PR
NA

### Describe the problem that is addressed by this PR
1. The EventGrid Service team has introduced a new Client called
`EventGridClient` with 4 apis - `publishCloudEvent`,
`publishCloudEvents`, `receiveCloudEvents`, `acknowledgeCloudEvents`,
`releaseCloudEvents` and `rejectCloudEvents`. Now, the service is
represented using the [new CADL
specification](https://github.com/Azure/azure-rest-api-specs/tree/feature/eventgrid/typespec/specification/eventgrid/Azure.Messaging.EventGrid).
This SDK, in this PR, has been generated using the new [JS SDK CADL
Generator](https://github.com/Azure/autorest.typescript/tree/main/packages/typespec-ts).

2. During the generation process, I had a few issues in the generation
process. Seperate issues have been filed for the same and many of them
have already been resolved. For the remaining issues, I have provided
manual patches in this PR, so the release schedule will not be impacted.
Jose is already working on fixing any remaining issues. A complete list
of issues can be found in the related PRs/Issues section below.

3. This is a **beta** release. So, this code is not merged to the main
branch. The code changes are merged to a private branch
**feature/eventgrid/4_13_beta_1**.

**APIView To Approve** 

https://apiview.dev/Assemblies/Review/de09872b51a24f489981db711a73c430/2e0e731c80a840faab6df4c51acb6e95?diffRevisionId=2a4fb5a9265847c09428acb9b0581b0e&doc=False&diffOnly=True

### 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?
No special design considerations for the generation process.

### Are there test cases added in this PR? _(If not, why?)_
This version of the eventgrid service has not been released to public
and not available through azure portal. So, the test cases are not added
to this PR for now. Locally, I have tested the code changes with private
test resources and confirmed that the apis are working fine.

### Provide a list of related PRs/Issues _(if any)_
1. Azure/autorest.typescript#1818
2. Azure/autorest.typescript#1819
3. Azure/autorest.typescript#1820
4. Azure/autorest.typescript#1821
5. Azure/autorest.typescript#1851
6. Azure/autorest.typescript#1852
7. Azure/autorest.typescript#1853

### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
npx tsp compile main.tsp

### Checklists
- [X] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [X] Added a changelog (if necessary)

@joheredi @ellismg Please review and approve the PR. 

@xirzec FYI....
  • Loading branch information
sarangan12 authored May 22, 2023
1 parent 6886589 commit ff71fb3
Show file tree
Hide file tree
Showing 28 changed files with 1,606 additions and 13 deletions.
14 changes: 13 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@
},
{
"filename": "sdk/formrecognizer/ai-form-recognizer/README.md",
"words": ["iddocument"]
"words": [
"iddocument"
]
},
{
"filename": "sdk/formrecognizer/ai-form-recognizer/review/**/*.md",
Expand Down Expand Up @@ -405,6 +407,16 @@
"words": [
"protobuf"
]
},
{
"filename": "sdk/eventgrid/eventgrid/**/**/**.**",
"words": [
"Dicom",
"Agri",
"cadl",
"deseralization",
"tsdoc"
]
}
]
}
29 changes: 23 additions & 6 deletions common/config/rush/pnpm-lock.yaml

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

3 changes: 2 additions & 1 deletion sdk/eventgrid/eventgrid/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"plugins": ["@azure/azure-sdk"],
"extends": ["plugin:@azure/azure-sdk/azure-sdk-base"],
"rules": {
"@typescript-eslint/ban-types": "warn"
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/naming-convention": "warn"
}
}
6 changes: 6 additions & 0 deletions sdk/eventgrid/eventgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 4.13.0-beta.1 (2023-05-22)

### Features Added

- Added a new client `EventGridClient` to the `@azure/eventgrid` with `publishCloudEvent`, `publishCloudEvents`, `receiveCloudEvents`, `acknowledgeCloudEvents`, `releaseCloudEvents` and `rejectCloudEvents` apis.

## 4.12.0 (2023-05-17)

- No new changes for this release. This is to update the minor version of the release to indicate the new system events that were added in the `4.11.1` version.
Expand Down
5 changes: 3 additions & 2 deletions sdk/eventgrid/eventgrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "client",
"author": "Microsoft Corporation",
"description": "An isomorphic client library for the Azure Event Grid service.",
"version": "4.12.0",
"version": "4.13.0-beta.1",
"keywords": [
"node",
"azure",
Expand Down Expand Up @@ -93,7 +93,8 @@
"dependencies": {
"@azure/core-auth": "^1.3.0",
"@azure/core-client": "^1.5.0",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/core-rest-pipeline": "^1.1.3",
"@azure-rest/core-client": "^1.1.3",
"@azure/core-tracing": "^1.0.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0",
Expand Down
122 changes: 122 additions & 0 deletions sdk/eventgrid/eventgrid/review/eventgrid.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,31 @@

import { AzureKeyCredential } from '@azure/core-auth';
import { AzureSASCredential } from '@azure/core-auth';
import { ClientOptions as ClientOptions_2 } from '@azure-rest/core-client';
import { CommonClientOptions } from '@azure/core-client';
import { HttpResponse } from '@azure-rest/core-client';
import { KeyCredential } from '@azure/core-auth';
import { OperationOptions } from '@azure/core-client';
import { RawHttpHeadersInput } from '@azure/core-rest-pipeline';
import { SASCredential } from '@azure/core-auth';
import { TokenCredential } from '@azure/core-auth';

// @public (undocumented)
export interface AcknowledgeCloudEventsOptions extends RequestOptions {
contentType?: string;
}

// @public
export interface AcknowledgeOptions {
lockTokens: string[];
}

// @public
export interface AcknowledgeResult {
failedLockTokens: FailedLockToken[];
succeededLockTokens: string[];
}

// @public
export interface AcsChatEventBase {
recipientCommunicationIdentifier: CommunicationIdentifierModel;
Expand Down Expand Up @@ -438,6 +457,16 @@ export { AzureKeyCredential }

export { AzureSASCredential }

// @public
export interface BrokerProperties {
deliveryCount: number;
lockToken: string;
}

// @public (undocumented)
export interface ClientOptions extends ClientOptions_2 {
}

// @public
export interface CloudEvent<T> {
data?: T;
Expand All @@ -446,6 +475,7 @@ export interface CloudEvent<T> {
extensionAttributes?: Record<string, unknown>;
id: string;
source: string;
specversion?: string | "1.0";
subject?: string;
time?: Date;
type: string;
Expand Down Expand Up @@ -655,6 +685,17 @@ export interface DeviceTwinMetadata {
lastUpdated: string;
}

// @public
export class EventGridClient {
constructor(endpoint: string, credential: AzureKeyCredential, options?: ClientOptions);
acknowledgeCloudEvents(lockTokens: string[], topicName: string, eventSubscriptionName: string, options?: AcknowledgeCloudEventsOptions): Promise<AcknowledgeResult>;
publishCloudEvent<T>(event: CloudEvent<T>, topicName: string, options?: PublishCloudEventOptions): Promise<PublishResultOutput>;
publishCloudEvents<T>(events: CloudEvent<T>[], topicName: string, options?: PublishCloudEventsOptions): Promise<PublishResultOutput>;
receiveCloudEvents<T>(topicName: string, eventSubscriptionName: string, options?: ReceiveCloudEventsOptions): Promise<ReceiveResult<T>>;
rejectCloudEvents(lockTokens: string[], topicName: string, eventSubscriptionName: string, options?: RejectCloudEventsOptions): Promise<RejectResult>;
releaseCloudEvents(lockTokens: string[], topicName: string, eventSubscriptionName: string, options?: ReleaseCloudEventsOptions): Promise<ReleaseResult>;
}

// @public
export class EventGridDeserializer {
deserializeCloudEvents(encodedEvents: string): Promise<CloudEvent<unknown>[]>;
Expand Down Expand Up @@ -698,6 +739,13 @@ export interface EventHubCaptureFileCreatedEventData {
sizeInBytes: number;
}

// @public
export interface FailedLockToken {
errorCode: string;
errorDescription: string;
lockToken: string;
}

// @public
export function generateSharedAccessSignature(endpointUrl: string, credential: KeyCredential, expiresOnUtc: Date, options?: GenerateSharedAccessSignatureOptions): Promise<string>;

Expand Down Expand Up @@ -1284,6 +1332,37 @@ export interface PolicyInsightsPolicyStateDeletedEventData {
timestamp: string;
}

// @public (undocumented)
export interface PublishCloudEventOptions extends RequestOptions {
contentType?: string;
}

// @public (undocumented)
export interface PublishCloudEventsOptions extends RequestOptions {
contentType?: string;
}

// @public
export interface PublishResultOutput {
}

// @public (undocumented)
export interface ReceiveCloudEventsOptions extends RequestOptions {
maxEvents?: number;
maxWaitTime?: number;
}

// @public
export interface ReceiveDetails<T> {
brokerProperties: BrokerProperties;
event: CloudEvent<T>;
}

// @public
export interface ReceiveResult<T> {
value: ReceiveDetails<T>[];
}

// @public
export type RecordingChannelType = string;

Expand All @@ -1293,6 +1372,49 @@ export type RecordingContentType = string;
// @public
export type RecordingFormatType = string;

// @public (undocumented)
export interface RejectCloudEventsOptions extends RequestOptions {
contentType?: string;
}

// @public
export interface RejectOptions {
lockTokens: string[];
}

// @public
export interface RejectResult {
failedLockTokens: FailedLockToken[];
succeededLockTokens: string[];
}

// @public (undocumented)
export interface ReleaseCloudEventsOptions extends RequestOptions {
contentType?: string;
}

// @public
export interface ReleaseOptions {
lockTokens: string[];
}

// @public
export interface ReleaseResult {
failedLockTokens: FailedLockToken[];
succeededLockTokens: string[];
}

// @public (undocumented)
export interface RequestOptions {
// (undocumented)
requestOptions?: {
headers?: RawHttpHeadersInput;
allowInsecureConnection?: boolean;
skipUrlEncoding?: boolean;
onResponse?: (response: HttpResponse) => void;
};
}

// @public
export interface ResourceActionCancelEventData {
authorization: ResourceAuthorization;
Expand Down
Loading

0 comments on commit ff71fb3

Please sign in to comment.