@azure/eventgrid 4.13.0-alpha.20230607.3 → 4.13.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +430 -76
- package/dist/index.js.map +1 -1
- package/dist-esm/src/cadl-generated/EventGridClient.js +28 -0
- package/dist-esm/src/cadl-generated/EventGridClient.js.map +1 -0
- package/dist-esm/src/cadl-generated/api/EventGridContext.js +11 -0
- package/dist-esm/src/cadl-generated/api/EventGridContext.js.map +1 -0
- package/dist-esm/src/cadl-generated/api/index.js +5 -0
- package/dist-esm/src/cadl-generated/api/index.js.map +1 -0
- package/dist-esm/src/cadl-generated/api/models.js +2 -0
- package/dist-esm/src/cadl-generated/api/models.js.map +1 -0
- package/dist-esm/src/cadl-generated/api/operations.js +162 -0
- package/dist-esm/src/cadl-generated/api/operations.js.map +1 -0
- package/dist-esm/src/cadl-generated/common/interfaces.js +4 -0
- package/dist-esm/src/cadl-generated/common/interfaces.js.map +1 -0
- package/dist-esm/src/cadl-generated/index.js +4 -0
- package/dist-esm/src/cadl-generated/index.js.map +1 -0
- package/dist-esm/src/cadl-generated/logger.js +5 -0
- package/dist-esm/src/cadl-generated/logger.js.map +1 -0
- package/dist-esm/src/cadl-generated/rest/clientDefinitions.js +4 -0
- package/dist-esm/src/cadl-generated/rest/clientDefinitions.js.map +1 -0
- package/dist-esm/src/cadl-generated/rest/eventGridClient.js +30 -0
- package/dist-esm/src/cadl-generated/rest/eventGridClient.js.map +1 -0
- package/dist-esm/src/cadl-generated/rest/index.js +12 -0
- package/dist-esm/src/cadl-generated/rest/index.js.map +1 -0
- package/dist-esm/src/cadl-generated/rest/isUnexpected.js +74 -0
- package/dist-esm/src/cadl-generated/rest/isUnexpected.js.map +1 -0
- package/dist-esm/src/cadl-generated/rest/models.js +4 -0
- package/dist-esm/src/cadl-generated/rest/models.js.map +1 -0
- package/dist-esm/src/cadl-generated/rest/outputModels.js +4 -0
- package/dist-esm/src/cadl-generated/rest/outputModels.js.map +1 -0
- package/dist-esm/src/cadl-generated/rest/parameters.js +4 -0
- package/dist-esm/src/cadl-generated/rest/parameters.js.map +1 -0
- package/dist-esm/src/cadl-generated/rest/responses.js +4 -0
- package/dist-esm/src/cadl-generated/rest/responses.js.map +1 -0
- package/dist-esm/src/eventGridClientV2.js +128 -0
- package/dist-esm/src/eventGridClientV2.js.map +1 -0
- package/dist-esm/src/generated/generatedClientContext.js +1 -1
- package/dist-esm/src/generated/generatedClientContext.js.map +1 -1
- package/dist-esm/src/generated/models/index.js.map +1 -1
- package/dist-esm/src/generated/models/mappers.js +0 -65
- package/dist-esm/src/generated/models/mappers.js.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/predicates.js.map +1 -1
- package/dist-esm/src/tracing.js +1 -1
- package/dist-esm/src/tracing.js.map +1 -1
- package/package.json +6 -5
- package/types/eventgrid.d.ts +216 -37
package/types/eventgrid.d.ts
CHANGED
@@ -1,11 +1,33 @@
|
|
1
1
|
import { AzureKeyCredential } from '@azure/core-auth';
|
2
2
|
import { AzureSASCredential } from '@azure/core-auth';
|
3
|
+
import { ClientOptions as ClientOptions_2 } from '@azure-rest/core-client';
|
3
4
|
import { CommonClientOptions } from '@azure/core-client';
|
5
|
+
import { HttpResponse } from '@azure-rest/core-client';
|
4
6
|
import { KeyCredential } from '@azure/core-auth';
|
5
7
|
import { OperationOptions } from '@azure/core-client';
|
8
|
+
import { RawHttpHeadersInput } from '@azure/core-rest-pipeline';
|
6
9
|
import { SASCredential } from '@azure/core-auth';
|
7
10
|
import { TokenCredential } from '@azure/core-auth';
|
8
11
|
|
12
|
+
export declare interface AcknowledgeCloudEventsOptions extends RequestOptions {
|
13
|
+
/** content type */
|
14
|
+
contentType?: string;
|
15
|
+
}
|
16
|
+
|
17
|
+
/** Array of lock token strings for the corresponding received Cloud Events to be acknowledged. */
|
18
|
+
export declare interface AcknowledgeOptions {
|
19
|
+
/** String array of lock tokens. */
|
20
|
+
lockTokens: string[];
|
21
|
+
}
|
22
|
+
|
23
|
+
/** The result of the Acknowledge operation. */
|
24
|
+
export declare interface AcknowledgeResult {
|
25
|
+
/** Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description). */
|
26
|
+
failedLockTokens: FailedLockToken[];
|
27
|
+
/** Array of lock tokens values for the successfully acknowledged cloud events. */
|
28
|
+
succeededLockTokens: string[];
|
29
|
+
}
|
30
|
+
|
9
31
|
/** Schema of common properties of all chat events */
|
10
32
|
export declare interface AcsChatEventBase {
|
11
33
|
/** The communication identifier of the target user */
|
@@ -618,6 +640,17 @@ export { AzureKeyCredential }
|
|
618
640
|
|
619
641
|
export { AzureSASCredential }
|
620
642
|
|
643
|
+
/** Properties of the Event Broker operation. */
|
644
|
+
export declare interface BrokerProperties {
|
645
|
+
/** The token used to lock the event. */
|
646
|
+
lockToken: string;
|
647
|
+
/** The attempt count for delivering the event. */
|
648
|
+
deliveryCount: number;
|
649
|
+
}
|
650
|
+
|
651
|
+
export declare interface ClientOptions extends ClientOptions_2 {
|
652
|
+
}
|
653
|
+
|
621
654
|
/**
|
622
655
|
* An event in the Cloud Event 1.0 schema.
|
623
656
|
*/
|
@@ -658,6 +691,10 @@ export declare interface CloudEvent<T> {
|
|
658
691
|
* Additional context attributes for the event. The Cloud Event specification refers to these as "extension attributes".
|
659
692
|
*/
|
660
693
|
extensionAttributes?: Record<string, unknown>;
|
694
|
+
/**
|
695
|
+
* The version of the CloudEvents specification which the event uses.
|
696
|
+
*/
|
697
|
+
specversion?: string | "1.0";
|
661
698
|
}
|
662
699
|
|
663
700
|
/**
|
@@ -819,18 +856,6 @@ export declare type ContainerRegistryImageDeletedEventData = ContainerRegistryEv
|
|
819
856
|
/** Schema of the Data property of an EventGridEvent for a Microsoft.ContainerRegistry.ImagePushed event. */
|
820
857
|
export declare type ContainerRegistryImagePushedEventData = ContainerRegistryEventData & {};
|
821
858
|
|
822
|
-
/** Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.ClusterSupportEnded event */
|
823
|
-
export declare type ContainerServiceClusterSupportEndedEventData = ContainerServiceClusterSupportEventData & {};
|
824
|
-
|
825
|
-
/** Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.ClusterSupportEnding event */
|
826
|
-
export declare type ContainerServiceClusterSupportEndingEventData = ContainerServiceClusterSupportEventData & {};
|
827
|
-
|
828
|
-
/** Schema of common properties of cluster support events */
|
829
|
-
export declare interface ContainerServiceClusterSupportEventData {
|
830
|
-
/** The Kubernetes version of the ManagedCluster resource */
|
831
|
-
kubernetesVersion: string;
|
832
|
-
}
|
833
|
-
|
834
859
|
/** Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NewKubernetesVersionAvailable event */
|
835
860
|
export declare interface ContainerServiceNewKubernetesVersionAvailableEventData {
|
836
861
|
/** The highest PATCH Kubernetes version for the highest MINOR version supported by ManagedCluster resource */
|
@@ -843,21 +868,6 @@ export declare interface ContainerServiceNewKubernetesVersionAvailableEventData
|
|
843
868
|
latestPreviewKubernetesVersion: string;
|
844
869
|
}
|
845
870
|
|
846
|
-
/** Schema of common properties of node pool rolling events */
|
847
|
-
export declare interface ContainerServiceNodePoolRollingEventData {
|
848
|
-
/** The name of the node pool in the ManagedCluster resource */
|
849
|
-
nodePoolName: string;
|
850
|
-
}
|
851
|
-
|
852
|
-
/** Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NodePoolRollingFailed event */
|
853
|
-
export declare type ContainerServiceNodePoolRollingFailedEventData = ContainerServiceNodePoolRollingEventData & {};
|
854
|
-
|
855
|
-
/** Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NodePoolRollingStarted event */
|
856
|
-
export declare type ContainerServiceNodePoolRollingStartedEventData = ContainerServiceNodePoolRollingEventData & {};
|
857
|
-
|
858
|
-
/** Schema of the Data property of an EventGridEvent for a Microsoft.ContainerService.NodePoolRollingSucceeded event */
|
859
|
-
export declare type ContainerServiceNodePoolRollingSucceededEventData = ContainerServiceNodePoolRollingEventData & {};
|
860
|
-
|
861
871
|
/** Schema of the Data property of an EventGridEvent for a Microsoft.DataBox.CopyCompleted event. */
|
862
872
|
export declare interface DataBoxCopyCompletedEventData {
|
863
873
|
/** Serial Number of the device associated with the event. The list is comma separated if more than one serial number is associated. */
|
@@ -997,6 +1007,85 @@ export declare interface DeviceTwinMetadata {
|
|
997
1007
|
lastUpdated: string;
|
998
1008
|
}
|
999
1009
|
|
1010
|
+
/**
|
1011
|
+
* Event Grid Client
|
1012
|
+
*/
|
1013
|
+
export declare class EventGridClient {
|
1014
|
+
private _client;
|
1015
|
+
/** Azure Messaging EventGrid Client */
|
1016
|
+
constructor(endpoint: string, credential: AzureKeyCredential, options?: ClientOptions);
|
1017
|
+
/**
|
1018
|
+
* Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200
|
1019
|
+
* status code with an empty JSON object in response. Otherwise, the server can return various error codes.
|
1020
|
+
* For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message
|
1021
|
+
* is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for
|
1022
|
+
* internal server error.
|
1023
|
+
*
|
1024
|
+
* @param event - Event to publish
|
1025
|
+
* @param topicName - Topic to publish the event
|
1026
|
+
* @param options - Options to publish
|
1027
|
+
*
|
1028
|
+
*/
|
1029
|
+
publishCloudEvent<T>(event: CloudEvent<T>, topicName: string, options?: PublishCloudEventOptions): Promise<PublishResultOutput>;
|
1030
|
+
/**
|
1031
|
+
* Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200
|
1032
|
+
* status code with an empty JSON object in response. Otherwise, the server can return various error codes.
|
1033
|
+
* For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message
|
1034
|
+
* is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for
|
1035
|
+
* internal server error.
|
1036
|
+
*
|
1037
|
+
* @param events - Events to publish
|
1038
|
+
* @param topicName - Topic to publish the event
|
1039
|
+
* @param options - Options to publish
|
1040
|
+
*
|
1041
|
+
*/
|
1042
|
+
publishCloudEvents<T>(events: CloudEvent<T>[], topicName: string, options?: PublishCloudEventsOptions): Promise<PublishResultOutput>;
|
1043
|
+
/**
|
1044
|
+
* Receive Batch of Cloud Events from the Event Subscription.
|
1045
|
+
*
|
1046
|
+
* @param topicName - Topic to receive
|
1047
|
+
* @param eventSubscriptionName - Name of the Event Subscription
|
1048
|
+
* @param options - Options to receive
|
1049
|
+
*
|
1050
|
+
*/
|
1051
|
+
receiveCloudEvents<T>(topicName: string, eventSubscriptionName: string, options?: ReceiveCloudEventsOptions): Promise<ReceiveResult<T>>;
|
1052
|
+
/**
|
1053
|
+
* Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if at least one
|
1054
|
+
* event is successfully acknowledged. The response body will include the set of successfully acknowledged
|
1055
|
+
* lockTokens, along with other failed lockTokens with their corresponding error information. Successfully
|
1056
|
+
* acknowledged events will no longer be available to any consumer.
|
1057
|
+
*
|
1058
|
+
* @param lockTokens - Lock Tokens
|
1059
|
+
* @param topicName - Topic Name
|
1060
|
+
* @param eventSubscriptionName - Name of the Event Subscription
|
1061
|
+
* @param options - Options to Acknowledge
|
1062
|
+
*
|
1063
|
+
*/
|
1064
|
+
acknowledgeCloudEvents(lockTokens: string[], topicName: string, eventSubscriptionName: string, options?: AcknowledgeCloudEventsOptions): Promise<AcknowledgeResult>;
|
1065
|
+
/**
|
1066
|
+
* Release batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is
|
1067
|
+
* successfully released. The response body will include the set of successfully released lockTokens, along
|
1068
|
+
* with other failed lockTokens with their corresponding error information.
|
1069
|
+
*
|
1070
|
+
* @param lockTokens - Lock Tokens
|
1071
|
+
* @param topicName - Topic Name
|
1072
|
+
* @param eventSubscriptionName - Name of the Event Subscription
|
1073
|
+
* @param options - Options to release
|
1074
|
+
*
|
1075
|
+
*/
|
1076
|
+
releaseCloudEvents(lockTokens: string[], topicName: string, eventSubscriptionName: string, options?: ReleaseCloudEventsOptions): Promise<ReleaseResult>;
|
1077
|
+
/**
|
1078
|
+
* Reject batch of Cloud Events.
|
1079
|
+
*
|
1080
|
+
* @param lockTokens - Lock Tokens
|
1081
|
+
* @param topicName - Topic Name
|
1082
|
+
* @param eventSubscriptionName - Name of the Event Subscription
|
1083
|
+
* @param options - Options to reject
|
1084
|
+
*
|
1085
|
+
*/
|
1086
|
+
rejectCloudEvents(lockTokens: string[], topicName: string, eventSubscriptionName: string, options?: RejectCloudEventsOptions): Promise<RejectResult>;
|
1087
|
+
}
|
1088
|
+
|
1000
1089
|
/**
|
1001
1090
|
* EventGridDeserializer is used to aid in processing events delivered by EventGrid. It can deserialize a JSON encoded payload
|
1002
1091
|
* of either a single event or batch of events as well as be used to convert the result of `JSON.parse` into an
|
@@ -1147,6 +1236,16 @@ export declare interface EventHubCaptureFileCreatedEventData {
|
|
1147
1236
|
lastEnqueueTime: string;
|
1148
1237
|
}
|
1149
1238
|
|
1239
|
+
/** Failed LockToken information. */
|
1240
|
+
export declare interface FailedLockToken {
|
1241
|
+
/** LockToken value */
|
1242
|
+
lockToken: string;
|
1243
|
+
/** Error code related to the token. Example of such error codes are BadToken: which indicates the Token is not formatted correctly, TokenLost: which indicates that token is not found, and InternalServerError: For any internal server errors. */
|
1244
|
+
errorCode: string;
|
1245
|
+
/** Description of the token error. */
|
1246
|
+
errorDescription: string;
|
1247
|
+
}
|
1248
|
+
|
1150
1249
|
/**
|
1151
1250
|
* Generate a shared access signature, which allows a client to send events to an Event Grid Topic or Domain for a limited period of time. This
|
1152
1251
|
* function may only be called when the EventGridPublisherClient was constructed with a KeyCredential instance.
|
@@ -2444,6 +2543,41 @@ export declare interface PolicyInsightsPolicyStateDeletedEventData {
|
|
2444
2543
|
complianceReasonCode: string;
|
2445
2544
|
}
|
2446
2545
|
|
2546
|
+
export declare interface PublishCloudEventOptions extends RequestOptions {
|
2547
|
+
/** content type */
|
2548
|
+
contentType?: string;
|
2549
|
+
}
|
2550
|
+
|
2551
|
+
export declare interface PublishCloudEventsOptions extends RequestOptions {
|
2552
|
+
/** content type */
|
2553
|
+
contentType?: string;
|
2554
|
+
}
|
2555
|
+
|
2556
|
+
/** The result of the Publish operation. */
|
2557
|
+
export declare interface PublishResultOutput {
|
2558
|
+
}
|
2559
|
+
|
2560
|
+
export declare interface ReceiveCloudEventsOptions extends RequestOptions {
|
2561
|
+
/** Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. */
|
2562
|
+
maxEvents?: number;
|
2563
|
+
/** Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. */
|
2564
|
+
maxWaitTime?: number;
|
2565
|
+
}
|
2566
|
+
|
2567
|
+
/** Receive operation details per Cloud Event. */
|
2568
|
+
export declare interface ReceiveDetails<T> {
|
2569
|
+
/** The Event Broker details. */
|
2570
|
+
brokerProperties: BrokerProperties;
|
2571
|
+
/** Cloud Event details. */
|
2572
|
+
event: CloudEvent<T>;
|
2573
|
+
}
|
2574
|
+
|
2575
|
+
/** Details of the Receive operation response. */
|
2576
|
+
export declare interface ReceiveResult<T> {
|
2577
|
+
/** Array of receive responses, one per cloud event. */
|
2578
|
+
value: ReceiveDetails<T>[];
|
2579
|
+
}
|
2580
|
+
|
2447
2581
|
/**
|
2448
2582
|
* Defines values for RecordingChannelType. \
|
2449
2583
|
* {@link KnownRecordingChannelType} can be used interchangeably with RecordingChannelType,
|
@@ -2475,6 +2609,61 @@ export declare type RecordingContentType = string;
|
|
2475
2609
|
*/
|
2476
2610
|
export declare type RecordingFormatType = string;
|
2477
2611
|
|
2612
|
+
export declare interface RejectCloudEventsOptions extends RequestOptions {
|
2613
|
+
/** content type */
|
2614
|
+
contentType?: string;
|
2615
|
+
}
|
2616
|
+
|
2617
|
+
/** Array of lock token strings for the corresponding received Cloud Events to be rejected. */
|
2618
|
+
export declare interface RejectOptions {
|
2619
|
+
/** String array of lock tokens. */
|
2620
|
+
lockTokens: string[];
|
2621
|
+
}
|
2622
|
+
|
2623
|
+
/** The result of the Reject operation. */
|
2624
|
+
export declare interface RejectResult {
|
2625
|
+
/** Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description). */
|
2626
|
+
failedLockTokens: FailedLockToken[];
|
2627
|
+
/** Array of lock tokens values for the successfully rejected cloud events. */
|
2628
|
+
succeededLockTokens: string[];
|
2629
|
+
}
|
2630
|
+
|
2631
|
+
export declare interface ReleaseCloudEventsOptions extends RequestOptions {
|
2632
|
+
/** content type */
|
2633
|
+
contentType?: string;
|
2634
|
+
}
|
2635
|
+
|
2636
|
+
/** Array of lock token strings for the corresponding received Cloud Events to be released. */
|
2637
|
+
export declare interface ReleaseOptions {
|
2638
|
+
/** String array of lock tokens. */
|
2639
|
+
lockTokens: string[];
|
2640
|
+
}
|
2641
|
+
|
2642
|
+
/** The result of the Release operation. */
|
2643
|
+
export declare interface ReleaseResult {
|
2644
|
+
/** Array of LockToken values for failed cloud events. Each LockToken includes the lock token value along with the related error information (namely, the error code and description). */
|
2645
|
+
failedLockTokens: FailedLockToken[];
|
2646
|
+
/** Array of lock tokens values for the successfully released cloud events. */
|
2647
|
+
succeededLockTokens: string[];
|
2648
|
+
}
|
2649
|
+
|
2650
|
+
export declare interface RequestOptions {
|
2651
|
+
requestOptions?: {
|
2652
|
+
/**
|
2653
|
+
* Headers to send along with the request
|
2654
|
+
*/
|
2655
|
+
headers?: RawHttpHeadersInput;
|
2656
|
+
/** Set to true if the request is sent over HTTP instead of HTTPS */
|
2657
|
+
allowInsecureConnection?: boolean;
|
2658
|
+
/** Set to true if you want to skip encoding the path parameters */
|
2659
|
+
skipUrlEncoding?: boolean;
|
2660
|
+
/**
|
2661
|
+
* Callback to access the raw response object when the response is received
|
2662
|
+
*/
|
2663
|
+
onResponse?: (response: HttpResponse) => void;
|
2664
|
+
};
|
2665
|
+
}
|
2666
|
+
|
2478
2667
|
/** Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled. */
|
2479
2668
|
export declare interface ResourceActionCancelEventData {
|
2480
2669
|
/** The tenant ID of the resource. */
|
@@ -3458,16 +3647,6 @@ export declare interface SystemEventNameToEventData {
|
|
3458
3647
|
"Microsoft.ApiManagement.GatewayAPIRemoved": ApiManagementGatewayApiRemovedEventData;
|
3459
3648
|
/** An interface for the event data of a "Microsoft.HealthcareApis.DicomImageUpdated" event. */
|
3460
3649
|
"Microsoft.HealthcareApis.DicomImageUpdated": HealthcareDicomImageUpdatedEventData;
|
3461
|
-
/** An interface for the event data of a "Microsoft.ContainerService.ClusterSupportEnded" event. */
|
3462
|
-
"Microsoft.ContainerService.ClusterSupportEnded": ContainerServiceClusterSupportEndedEventData;
|
3463
|
-
/** An interface for the event data of a "Microsoft.ContainerService.ClusterSupportEnding" event. */
|
3464
|
-
"Microsoft.ContainerService.ClusterSupportEnding": ContainerServiceClusterSupportEndingEventData;
|
3465
|
-
/** An interface for the event data of a "Microsoft.ContainerService.NodePoolRollingStarted" event. */
|
3466
|
-
"Microsoft.ContainerService.NodePoolRollingStarted": ContainerServiceNodePoolRollingStartedEventData;
|
3467
|
-
/** An interface for the event data of a "Microsoft.ContainerService.NodePoolRollingSucceeded" event. */
|
3468
|
-
"Microsoft.ContainerService.NodePoolRollingSucceeded": ContainerServiceNodePoolRollingSucceededEventData;
|
3469
|
-
/** An interface for the event data of a "Microsoft.ContainerService.NodePoolRollingFailed" event. */
|
3470
|
-
"Microsoft.ContainerService.NodePoolRollingFailed": ContainerServiceNodePoolRollingFailedEventData;
|
3471
3650
|
}
|
3472
3651
|
|
3473
3652
|
/** Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event. */
|