@azure/eventgrid-namespaces 1.0.0-beta.1 → 1.0.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/README.md CHANGED
@@ -6,11 +6,11 @@ Use the client library to Send events to Event Grid Namespaces
6
6
 
7
7
  Key links:
8
8
 
9
- - [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/eventgrid/eventgrid/)
9
+ - [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/eventgrid/eventgrid-namespaces/)
10
10
  - [Package (NPM)](https://www.npmjs.com/package/@azure/eventgrid-namespaces)
11
11
  - [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/eventgrid/)
12
12
  - [Product documentation](https://docs.microsoft.com/azure/event-grid/)
13
- - [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventgrid/eventgrid/samples)
13
+ - [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventgrid/eventgrid-namespaces/samples)
14
14
 
15
15
  ## Getting started
16
16
 
@@ -69,9 +69,9 @@ az eventgrid topic key list --resource-group <your-resource-group-name> --name <
69
69
  Once you have an API key and endpoint, you can use the `AzureKeyCredential` class to authenticate the client as follows:
70
70
 
71
71
  ```js
72
- const { EventGridNamespacesClient, AzureKeyCredential } = require("@azure/eventgrid-namespaces");
72
+ const { EventGridClient, AzureKeyCredential } = require("@azure/eventgrid-namespaces");
73
73
 
74
- const client = new EventGridNamespacesClient(
74
+ const client = new EventGridClient(
75
75
  "<endpoint>",
76
76
  new AzureKeyCredential("<Access Key>")
77
77
  );
@@ -86,10 +86,10 @@ With the `@azure/identity` package, you can seamlessly authorize requests in bot
86
86
  For example, use can use `DefaultAzureCredential` to construct a client which will authenticate using Azure Active Directory:
87
87
 
88
88
  ```js
89
- const { EventGridNamespacesClient } = require("@azure/eventgrid-namespaces");
89
+ const { EventGridClient } = require("@azure/eventgrid-namespaces");
90
90
  const { DefaultAzureCredential } = require("@azure/identity");
91
91
 
92
- const client = new EventGridNamespacesClient(
92
+ const client = new EventGridClient(
93
93
  "<endpoint>",
94
94
  new DefaultAzureCredential()
95
95
  );
@@ -102,7 +102,7 @@ const client = new EventGridNamespacesClient(
102
102
  `EventGridNamespacesClient` is used sending events to an Event Grid. You can initialize it as:
103
103
 
104
104
  ```js
105
- const client = new EventGridNamespacesClient(
105
+ const client = new EventGridClient(
106
106
  "<endpoint>",
107
107
  new AzureKeyCredential("<API Key>")
108
108
  );
@@ -121,9 +121,9 @@ This library has been tested and validated on [Kubernetes using Azure Arc][event
121
121
  ### Publish an Event to an Event Grid Topic
122
122
 
123
123
  ```js
124
- const { EventGridNamespacesClient, AzureKeyCredential } = require("@azure/eventgrid-namespaces");
124
+ const { EventGridClient, AzureKeyCredential } = require("@azure/eventgrid-namespaces");
125
125
 
126
- const client = new EventGridNamespacesClient(
126
+ const client = new EventGridClient(
127
127
  "<endpoint>",
128
128
  new AzureKeyCredential("<API key>")
129
129
  );
@@ -159,7 +159,7 @@ For more detailed instructions on how to enable the logs, you can look at the [@
159
159
  ## Next steps
160
160
 
161
161
  Please take a look at the
162
- [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventgrid/eventgrid/samples)
162
+ [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventgrid/eventgrid-namespaces/samples)
163
163
  directory for detailed examples on how to use this library.
164
164
 
165
165
  ## Contributing
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ var coreUtil = require('@azure/core-util');
7
7
  var coreClient = require('@azure-rest/core-client');
8
8
  var logger$1 = require('@azure/logger');
9
9
  var buffer = require('buffer');
10
+ var eventgrid = require('@azure/eventgrid');
10
11
 
11
12
  // Copyright (c) Microsoft Corporation.
12
13
  // Licensed under the MIT license.
@@ -596,5 +597,9 @@ Object.defineProperty(exports, "AzureKeyCredential", {
596
597
  enumerable: true,
597
598
  get: function () { return coreAuth.AzureKeyCredential; }
598
599
  });
600
+ Object.defineProperty(exports, "EventGridDeserializer", {
601
+ enumerable: true,
602
+ get: function () { return eventgrid.EventGridDeserializer; }
603
+ });
599
604
  exports.EventGridClient = EventGridNamespacesClient;
600
605
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/cadl-generated/logger.ts","../src/cadl-generated/rest/eventGridClient.ts","../src/cadl-generated/rest/isUnexpected.ts","../src/cadl-generated/api/EventGridContext.ts","../src/cadl-generated/api/operations.ts","../src/cadl-generated/EventGridClient.ts","../src/models.ts","../src/eventGridNamespacesPublishBinaryMode.ts","../src/eventGridNamespacesClient.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"eventgrid-namespaces\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"../logger\";\nimport { TokenCredential, KeyCredential, isKeyCredential } from \"@azure/core-auth\";\nimport { EventGridContext } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `EventGridContext`\n * @param endpoint - The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential | KeyCredential,\n options: ClientOptions = {},\n): EventGridContext {\n const baseUrl = options.baseUrl ?? `${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"2023-10-01-preview\";\n const userAgentInfo = `azsdk-js-eventgrid-namespaces-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://eventgrid.azure.net/.default\"],\n apiKeyHeaderName: \"Authorization\",\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as EventGridContext;\n\n if (isKeyCredential(credentials)) {\n client.pipeline.addPolicy({\n name: \"customKeyCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", \"SharedAccessKey \" + credentials.key);\n return next(request);\n },\n });\n }\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PublishCloudEvent200Response,\n PublishCloudEvents200Response,\n PublishCloudEventDefaultResponse,\n ReceiveCloudEvents200Response,\n ReceiveCloudEventsDefaultResponse,\n AcknowledgeCloudEvents200Response,\n AcknowledgeCloudEventsDefaultResponse,\n ReleaseCloudEvents200Response,\n ReleaseCloudEventsDefaultResponse,\n RejectCloudEvents200Response,\n RejectCloudEventsDefaultResponse,\n RenewCloudEventLocks200Response,\n RenewCloudEventLocksDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"POST /topics/{topicName}:publish\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | PublishCloudEvent200Response\n | PublishCloudEvents200Response\n | PublishCloudEventDefaultResponse,\n): response is PublishCloudEventDefaultResponse;\nexport function isUnexpected(\n response: ReceiveCloudEvents200Response | ReceiveCloudEventsDefaultResponse,\n): response is ReceiveCloudEventsDefaultResponse;\nexport function isUnexpected(\n response: AcknowledgeCloudEvents200Response | AcknowledgeCloudEventsDefaultResponse,\n): response is AcknowledgeCloudEventsDefaultResponse;\nexport function isUnexpected(\n response: ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse,\n): response is ReleaseCloudEventsDefaultResponse;\nexport function isUnexpected(\n response: RejectCloudEvents200Response | RejectCloudEventsDefaultResponse,\n): response is RejectCloudEventsDefaultResponse;\nexport function isUnexpected(\n response: RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse,\n): response is RenewCloudEventLocksDefaultResponse;\nexport function isUnexpected(\n response:\n | PublishCloudEvent200Response\n | PublishCloudEvents200Response\n | PublishCloudEventDefaultResponse\n | ReceiveCloudEvents200Response\n | ReceiveCloudEventsDefaultResponse\n | AcknowledgeCloudEvents200Response\n | AcknowledgeCloudEventsDefaultResponse\n | ReleaseCloudEvents200Response\n | ReleaseCloudEventsDefaultResponse\n | RejectCloudEvents200Response\n | RejectCloudEventsDefaultResponse\n | RenewCloudEventLocks200Response\n | RenewCloudEventLocksDefaultResponse,\n): response is\n | PublishCloudEventDefaultResponse\n | ReceiveCloudEventsDefaultResponse\n | AcknowledgeCloudEventsDefaultResponse\n | ReleaseCloudEventsDefaultResponse\n | RejectCloudEventsDefaultResponse\n | RenewCloudEventLocksDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport { EventGridContext } from \"../rest/index\";\nimport getClient from \"../rest/index\";\n\nexport interface EventGridClientOptions extends ClientOptions {}\n\nexport { EventGridContext } from \"../rest/index\";\n\n/** Azure Messaging EventGrid Client */\nexport function createEventGrid(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options: EventGridClientOptions = {},\n): EventGridContext {\n const clientContext = getClient(endpoint, credential, options);\n return clientContext;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n AcknowledgeOptions,\n AcknowledgeResult,\n ReleaseOptions,\n ReleaseResult,\n RejectOptions,\n RejectResult,\n RenewLockOptions,\n RenewCloudEventLocksResult,\n} from \"../models/models\";\nimport {\n isUnexpected,\n EventGridContext as Client,\n AcknowledgeCloudEvents200Response,\n AcknowledgeCloudEventsDefaultResponse,\n PublishCloudEvent200Response,\n PublishCloudEventDefaultResponse,\n PublishCloudEvents200Response,\n PublishCloudEventsDefaultResponse,\n ReceiveCloudEvents200Response,\n ReceiveCloudEventsDefaultResponse,\n RejectCloudEvents200Response,\n RejectCloudEventsDefaultResponse,\n ReleaseCloudEvents200Response,\n ReleaseCloudEventsDefaultResponse,\n RenewCloudEventLocks200Response,\n RenewCloudEventLocksDefaultResponse,\n} from \"../rest/index\";\nimport {\n StreamableMethod,\n operationOptionsToRequestParameters,\n createRestError,\n} from \"@azure-rest/core-client\";\nimport { uint8ArrayToString, stringToUint8Array } from \"@azure/core-util\";\nimport {\n PublishCloudEventOptions,\n PublishCloudEventsOptions,\n ReceiveCloudEventsOptions,\n AcknowledgeCloudEventsOptions,\n ReleaseCloudEventsOptions,\n RejectCloudEventsOptions,\n RenewCloudEventLocksOptions,\n} from \"../models/options\";\n\nexport function _publishCloudEventSend(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n): StreamableMethod<PublishCloudEvent200Response | PublishCloudEventDefaultResponse> {\n return context.path(\"/topics/{topicName}:publish\", topicName).post({\n ...operationOptionsToRequestParameters(options),\n contentType: (options.contentType as any) ?? \"application/cloudevents+json; charset=utf-8\",\n body: {\n id: event[\"id\"],\n source: event[\"source\"],\n data: event[\"data\"],\n data_base64:\n event[\"dataBase64\"] !== undefined\n ? uint8ArrayToString(event[\"dataBase64\"], \"base64\")\n : undefined,\n type: event[\"type\"],\n time: event[\"time\"]?.toISOString(),\n specversion: event[\"specversion\"],\n dataschema: event[\"dataschema\"],\n datacontenttype: event[\"datacontenttype\"],\n subject: event[\"subject\"],\n },\n }) as StreamableMethod<PublishCloudEvent200Response | PublishCloudEventDefaultResponse>;\n}\n\nexport async function _publishCloudEventDeserialize(\n result: PublishCloudEvent200Response | PublishCloudEventDefaultResponse,\n): Promise<PublishResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return result.body;\n}\n\n/** Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. */\nexport async function publishCloudEvent(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n): Promise<PublishResult> {\n const result = await _publishCloudEventSend(context, topicName, event, options);\n return _publishCloudEventDeserialize(result);\n}\n\nexport function _publishCloudEventsSend(\n context: Client,\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<PublishCloudEvents200Response | PublishCloudEventsDefaultResponse> {\n return context.path(\"/topics/{topicName}:publish\", topicName).post({\n ...operationOptionsToRequestParameters(options),\n contentType:\n (options.contentType as any) ?? \"application/cloudevents-batch+json; charset=utf-8\",\n body: (events ?? []).map((p) => {\n return {\n id: p[\"id\"],\n source: p[\"source\"],\n data: p[\"data\"],\n data_base64:\n p[\"dataBase64\"] !== undefined ? uint8ArrayToString(p[\"dataBase64\"], \"base64\") : undefined,\n type: p[\"type\"],\n time: p[\"time\"]?.toISOString(),\n specversion: p[\"specversion\"],\n dataschema: p[\"dataschema\"],\n datacontenttype: p[\"datacontenttype\"],\n subject: p[\"subject\"],\n };\n }),\n }) as StreamableMethod<PublishCloudEvents200Response | PublishCloudEventsDefaultResponse>;\n}\n\nexport async function _publishCloudEventsDeserialize(\n result: PublishCloudEvents200Response | PublishCloudEventsDefaultResponse,\n): Promise<PublishResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return result.body;\n}\n\n/** Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. */\nexport async function publishCloudEvents(\n context: Client,\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptions = { requestOptions: {} },\n): Promise<PublishResult> {\n const result = await _publishCloudEventsSend(context, topicName, events, options);\n return _publishCloudEventsDeserialize(result);\n}\n\nexport function _receiveCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<ReceiveCloudEvents200Response | ReceiveCloudEventsDefaultResponse> {\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n queryParameters: {\n maxEvents: options?.maxEvents,\n maxWaitTime: options?.maxWaitTime,\n },\n });\n}\n\nexport async function _receiveCloudEventsDeserialize(\n result: ReceiveCloudEvents200Response | ReceiveCloudEventsDefaultResponse,\n): Promise<ReceiveResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n value: result.body[\"value\"].map((p) => ({\n brokerProperties: {\n lockToken: p.brokerProperties[\"lockToken\"],\n deliveryCount: p.brokerProperties[\"deliveryCount\"],\n },\n event: {\n id: p.event[\"id\"],\n source: p.event[\"source\"],\n data: p.event[\"data\"],\n dataBase64:\n typeof p.event[\"data_base64\"] === \"string\"\n ? stringToUint8Array(p.event[\"data_base64\"], \"base64\")\n : p.event[\"data_base64\"],\n type: p.event[\"type\"],\n time: p.event[\"time\"] !== undefined ? new Date(p.event[\"time\"]) : undefined,\n specversion: p.event[\"specversion\"],\n dataschema: p.event[\"dataschema\"],\n datacontenttype: p.event[\"datacontenttype\"],\n subject: p.event[\"subject\"],\n },\n })),\n };\n}\n\n/** Receive Batch of Cloud Events from the Event Subscription. */\nexport async function receiveCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptions = { requestOptions: {} },\n): Promise<ReceiveResult> {\n const result = await _receiveCloudEventsSend(context, topicName, eventSubscriptionName, options);\n return _receiveCloudEventsDeserialize(result);\n}\n\nexport function _acknowledgeCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n acknowledgeOptions: AcknowledgeOptions,\n options: AcknowledgeCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<AcknowledgeCloudEvents200Response | AcknowledgeCloudEventsDefaultResponse> {\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n body: { lockTokens: acknowledgeOptions[\"lockTokens\"] },\n });\n}\n\nexport async function _acknowledgeCloudEventsDeserialize(\n result: AcknowledgeCloudEvents200Response | AcknowledgeCloudEventsDefaultResponse,\n): Promise<AcknowledgeResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n failedLockTokens: result.body[\"failedLockTokens\"].map((p) => ({\n lockToken: p[\"lockToken\"],\n error: p.error,\n })),\n succeededLockTokens: result.body[\"succeededLockTokens\"],\n };\n}\n\n/** Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer. */\nexport async function acknowledgeCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n acknowledgeOptions: AcknowledgeOptions,\n options: AcknowledgeCloudEventsOptions = { requestOptions: {} },\n): Promise<AcknowledgeResult> {\n const result = await _acknowledgeCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n acknowledgeOptions,\n options,\n );\n return _acknowledgeCloudEventsDeserialize(result);\n}\n\nexport function _releaseCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n releaseOptions: ReleaseOptions,\n options: ReleaseCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse> {\n let releaseDelayInSeconds: number | undefined = undefined;\n if (options?.releaseDelayInSeconds) {\n releaseDelayInSeconds = parseInt(options.releaseDelayInSeconds);\n }\n\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n queryParameters: {\n releaseDelayInSeconds,\n },\n body: { lockTokens: releaseOptions[\"lockTokens\"] },\n });\n}\n\nexport async function _releaseCloudEventsDeserialize(\n result: ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse,\n): Promise<ReleaseResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n failedLockTokens: result.body[\"failedLockTokens\"].map((p) => ({\n lockToken: p[\"lockToken\"],\n error: p.error,\n })),\n succeededLockTokens: result.body[\"succeededLockTokens\"],\n };\n}\n\n/** Release batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information. */\nexport async function releaseCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n releaseOptions: ReleaseOptions,\n options: ReleaseCloudEventsOptions = { requestOptions: {} },\n): Promise<ReleaseResult> {\n const result = await _releaseCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n releaseOptions,\n options,\n );\n return _releaseCloudEventsDeserialize(result);\n}\n\nexport function _rejectCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n rejectOptions: RejectOptions,\n options: RejectCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<RejectCloudEvents200Response | RejectCloudEventsDefaultResponse> {\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n body: { lockTokens: rejectOptions[\"lockTokens\"] },\n });\n}\n\nexport async function _rejectCloudEventsDeserialize(\n result: RejectCloudEvents200Response | RejectCloudEventsDefaultResponse,\n): Promise<RejectResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n failedLockTokens: result.body[\"failedLockTokens\"].map((p) => ({\n lockToken: p[\"lockToken\"],\n error: p.error,\n })),\n succeededLockTokens: result.body[\"succeededLockTokens\"],\n };\n}\n\n/** Reject batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully rejected lockTokens, along with other failed lockTokens with their corresponding error information. */\nexport async function rejectCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n rejectOptions: RejectOptions,\n options: RejectCloudEventsOptions = { requestOptions: {} },\n): Promise<RejectResult> {\n const result = await _rejectCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n rejectOptions,\n options,\n );\n return _rejectCloudEventsDeserialize(result);\n}\n\nexport function _renewCloudEventLocksSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n renewLockOptions: RenewLockOptions,\n options: RenewCloudEventLocksOptions = { requestOptions: {} },\n): StreamableMethod<RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse> {\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n body: { lockTokens: renewLockOptions[\"lockTokens\"] },\n });\n}\n\nexport async function _renewCloudEventLocksDeserialize(\n result: RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse,\n): Promise<RenewCloudEventLocksResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n failedLockTokens: result.body[\"failedLockTokens\"].map((p) => ({\n lockToken: p[\"lockToken\"],\n error: p.error,\n })),\n succeededLockTokens: result.body[\"succeededLockTokens\"],\n };\n}\n\n/** Renew lock for batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully renewed lockTokens, along with other failed lockTokens with their corresponding error information. */\nexport async function renewCloudEventLocks(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n renewLockOptions: RenewLockOptions,\n options: RenewCloudEventLocksOptions = { requestOptions: {} },\n): Promise<RenewCloudEventLocksResult> {\n const result = await _renewCloudEventLocksSend(\n context,\n topicName,\n eventSubscriptionName,\n renewLockOptions,\n options,\n );\n return _renewCloudEventLocksDeserialize(result);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n AcknowledgeOptions,\n AcknowledgeResult,\n ReleaseOptions,\n ReleaseResult,\n RejectOptions,\n RejectResult,\n RenewLockOptions,\n RenewCloudEventLocksResult,\n} from \"./models/models\";\nimport {\n PublishCloudEventOptions,\n PublishCloudEventsOptions,\n ReceiveCloudEventsOptions,\n AcknowledgeCloudEventsOptions,\n ReleaseCloudEventsOptions,\n RejectCloudEventsOptions,\n RenewCloudEventLocksOptions,\n} from \"./models/options\";\nimport {\n createEventGrid,\n EventGridClientOptions,\n EventGridContext,\n publishCloudEvent,\n publishCloudEvents,\n receiveCloudEvents,\n acknowledgeCloudEvents,\n releaseCloudEvents,\n rejectCloudEvents,\n renewCloudEventLocks,\n} from \"./api/index\";\n\nexport { EventGridClientOptions } from \"./api/EventGridContext\";\n\nexport class EventGridClient {\n private _client: EventGridContext;\n\n getClient(): EventGridContext {\n return this._client;\n }\n\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n /** Azure Messaging EventGrid Client */\n constructor(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options: EventGridClientOptions = {},\n ) {\n this._client = createEventGrid(endpoint, credential, options);\n this.pipeline = this._client.pipeline;\n }\n\n /** Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. */\n publishCloudEvent(\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n ): Promise<PublishResult> {\n return publishCloudEvent(this._client, topicName, event, options);\n }\n\n /** Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. */\n publishCloudEvents(\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptions = { requestOptions: {} },\n ): Promise<PublishResult> {\n return publishCloudEvents(this._client, topicName, events, options);\n }\n\n /** Receive Batch of Cloud Events from the Event Subscription. */\n receiveCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptions = { requestOptions: {} },\n ): Promise<ReceiveResult> {\n return receiveCloudEvents(this._client, topicName, eventSubscriptionName, options);\n }\n\n /** Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer. */\n acknowledgeCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n acknowledgeOptions: AcknowledgeOptions,\n options: AcknowledgeCloudEventsOptions = { requestOptions: {} },\n ): Promise<AcknowledgeResult> {\n return acknowledgeCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n acknowledgeOptions,\n options,\n );\n }\n\n /** Release batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information. */\n releaseCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n releaseOptions: ReleaseOptions,\n options: ReleaseCloudEventsOptions = { requestOptions: {} },\n ): Promise<ReleaseResult> {\n return releaseCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n releaseOptions,\n options,\n );\n }\n\n /** Reject batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully rejected lockTokens, along with other failed lockTokens with their corresponding error information. */\n rejectCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n rejectOptions: RejectOptions,\n options: RejectCloudEventsOptions = { requestOptions: {} },\n ): Promise<RejectResult> {\n return rejectCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n rejectOptions,\n options,\n );\n }\n\n /** Renew lock for batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully renewed lockTokens, along with other failed lockTokens with their corresponding error information. */\n renewCloudEventLocks(\n topicName: string,\n eventSubscriptionName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n renewLockOptions: RenewLockOptions,\n options: RenewCloudEventLocksOptions = { requestOptions: {} },\n ): Promise<RenewCloudEventLocksResult> {\n return renewCloudEventLocks(\n this._client,\n topicName,\n eventSubscriptionName,\n renewLockOptions,\n options,\n );\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { OperationOptions } from \"@azure-rest/core-client\";\n\nexport interface PublishCloudEventOptions extends OperationOptions {\n /** binary mode */\n binaryMode?: boolean;\n\n /** content type */\n contentType?: string;\n}\n\n/**\n * An event in the Cloud Event 1.0 schema.\n */\nexport interface CloudEvent<T> {\n /**\n * Type of event related to the originating occurrence.\n */\n type: string;\n /**\n * Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event.\n */\n source: string;\n /**\n * An identifier for the event. The combination of id and source must be unique for each distinct event.\n */\n id: string;\n /**\n * The time the event was generated.\n */\n time?: Date;\n /**\n * Identifies the schema that data adheres to.\n */\n dataschema?: string;\n /**\n * Content type of data value.\n */\n datacontenttype?: string;\n /**\n * Event data specific to the event type.\n */\n data?: T;\n /**\n * This describes the subject of the event in the context of the event producer (identified by source).\n */\n subject?: string;\n /**\n * Additional context attributes for the event. The Cloud Event specification refers to these as \"extension attributes\".\n */\n extensionAttributes?: Record<string, unknown>;\n /**\n * The version of the CloudEvents specification which the event uses.\n */\n specversion?: string | \"1.0\";\n}\n\nexport const cloudEventReservedPropertyNames = [\n \"specversion\",\n \"id\",\n \"source\",\n \"type\",\n \"datacontenttype\",\n \"dataschema\",\n \"subject\",\n \"time\",\n \"data\",\n];\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n isUnexpected,\n EventGridContext as Client,\n PublishCloudEvent200Response,\n PublishCloudEventDefaultResponse,\n} from \"./cadl-generated/rest/index\";\nimport { StreamableMethod, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport { PublishCloudEventOptions } from \"./cadl-generated/models/options\";\nimport { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport { Buffer } from \"buffer\";\nimport { CloudEvent } from \"./cadl-generated\";\n\nexport async function publishCloudEventInBinaryMode(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n): Promise<Record<string, any>> {\n const result = await _publishCloudEventSendBinaryMode(context, topicName, event, options);\n return _publishCloudEventDeserialize(result);\n}\n\nexport async function _publishCloudEventDeserialize(\n result: PublishCloudEvent200Response | PublishCloudEventDefaultResponse,\n): Promise<Record<string, any>> {\n if (isUnexpected(result)) {\n throw result.body;\n }\n\n return result.body;\n}\n\nexport function _publishCloudEventSendBinaryMode(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n): StreamableMethod<PublishCloudEvent200Response | PublishCloudEventDefaultResponse> {\n const headers: RawHttpHeadersInput = {\n \"ce-id\": event.id,\n \"ce-source\": event.source,\n \"ce-type\": event.type,\n \"ce-specversion\": event.specversion,\n };\n\n if (event.time) {\n headers[\"ce-time\"] = event.time.toISOString();\n }\n\n if (event.dataschema) {\n headers[\"ce-dataschema\"] = event.dataschema;\n }\n\n if (event.datacontenttype) {\n headers[\"ce-datacontenttype\"] = event.datacontenttype;\n }\n\n if (event.subject) {\n headers[\"ce-subject\"] = event.subject;\n }\n\n let data: any;\n if (event.data) {\n // If data is already encoded\n if (Buffer.isBuffer(event.data)) {\n data = event.data;\n } else {\n throw new Error(`CloudEvent data must be binary when in binary mode.`);\n }\n } else {\n if (event.dataBase64) {\n data = event.dataBase64;\n }\n }\n\n return context.path(\"/topics/{topicName}:publish\", topicName).post({\n ...operationOptionsToRequestParameters(options),\n contentType: (options.contentType as any) ?? \"application/cloudevents+json; charset=utf-8\",\n headers,\n body: {\n id: event.id,\n source: event.source,\n data,\n type: event.type,\n time: event.time?.toISOString(),\n specversion: event.specversion,\n dataschema: event.dataschema,\n datacontenttype: event.datacontenttype,\n subject: event.subject,\n },\n });\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AzureKeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport {\n ReceiveResult,\n AcknowledgeResult,\n ReleaseResult,\n RejectResult,\n PublishCloudEventsOptions,\n ReceiveCloudEventsOptions,\n AcknowledgeCloudEventsOptions,\n ReleaseCloudEventsOptions,\n RejectCloudEventsOptions,\n RenewCloudEventLocksOptions,\n RenewCloudEventLocksResult,\n CloudEvent as CloudEventWireModel,\n} from \"./cadl-generated/models\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { EventGridClient as EventGridClientGenerated } from \"./cadl-generated/EventGridClient\";\nimport { EventGridClientOptions } from \"./cadl-generated/api\";\nimport { PublishCloudEventOptions, CloudEvent, cloudEventReservedPropertyNames } from \"./models\";\nimport { publishCloudEventInBinaryMode } from \"./eventGridNamespacesPublishBinaryMode\";\n\n/**\n * Event Grid Namespaces Client\n */\nexport class EventGridNamespacesClient {\n private _client: EventGridClientGenerated;\n\n /** Azure Messaging EventGrid Client */\n constructor(\n endpoint: string,\n credential: AzureKeyCredential | TokenCredential,\n options: EventGridClientOptions = {},\n ) {\n // credential.update(`SharedAccessKey ${credential.key}`);\n this._client = new EventGridClientGenerated(endpoint, credential, options);\n }\n\n /**\n * Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200\n * status code with an empty JSON object in response. Otherwise, the server can return various error codes.\n * For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message\n * is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for\n * internal server error.\n *\n * @param event - Event to publish\n * @param topicName - Topic to publish the event\n * @param options - Options to publish\n *\n */\n async publishCloudEvent<T>(\n event: CloudEvent<T>,\n topicName: string,\n options: PublishCloudEventOptions = { requestOptions: {} },\n ): Promise<void> {\n const cloudEventWireModel: CloudEventWireModel = convertCloudEventToModelType(event);\n\n if (!options.binaryMode) {\n await this._client.publishCloudEvent(topicName, cloudEventWireModel, options);\n } else {\n await publishCloudEventInBinaryMode(\n this._client.getClient(),\n topicName,\n cloudEventWireModel,\n {\n contentType: options.contentType,\n ...options,\n },\n );\n }\n }\n\n /**\n * Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200\n * status code with an empty JSON object in response. Otherwise, the server can return various error codes.\n * For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message\n * is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for\n * internal server error.\n *\n * @param events - Events to publish\n * @param topicName - Topic to publish the event\n * @param options - Options to publish\n *\n */\n async publishCloudEvents<T>(\n events: CloudEvent<T>[],\n topicName: string,\n options: PublishCloudEventsOptions = { requestOptions: {} },\n ): Promise<void> {\n const eventsWireModel: Array<CloudEventWireModel> = [];\n for (const individualevent of events) {\n eventsWireModel.push(convertCloudEventToModelType(individualevent));\n }\n await this._client.publishCloudEvents(topicName, eventsWireModel, options);\n }\n\n /**\n * Receive Batch of Cloud Events from the Event Subscription.\n *\n * @param topicName - Topic to receive\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to receive\n *\n */\n receiveCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptions = { requestOptions: {} },\n ): Promise<ReceiveResult> {\n return this._client.receiveCloudEvents(topicName, eventSubscriptionName, options);\n }\n\n /**\n * Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if at least one\n * event is successfully acknowledged. The response body will include the set of successfully acknowledged\n * lockTokens, along with other failed lockTokens with their corresponding error information. Successfully\n * acknowledged events will no longer be available to any consumer.\n *\n * @param lockTokens - Lock Tokens\n * @param topicName - Topic Name\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to Acknowledge\n *\n */\n acknowledgeCloudEvents(\n lockTokens: string[],\n topicName: string,\n eventSubscriptionName: string,\n options: AcknowledgeCloudEventsOptions = { requestOptions: {} },\n ): Promise<AcknowledgeResult> {\n return this._client.acknowledgeCloudEvents(\n topicName,\n eventSubscriptionName,\n { lockTokens },\n options,\n );\n }\n\n /**\n * Release batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is\n * successfully released. The response body will include the set of successfully released lockTokens, along\n * with other failed lockTokens with their corresponding error information.\n *\n * @param lockTokens - Lock Tokens\n * @param topicName - Topic Name\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to release\n *\n */\n releaseCloudEvents(\n lockTokens: string[],\n topicName: string,\n eventSubscriptionName: string,\n options: ReleaseCloudEventsOptions = { requestOptions: {} },\n ): Promise<ReleaseResult> {\n return this._client.releaseCloudEvents(\n topicName,\n eventSubscriptionName,\n { lockTokens },\n options,\n );\n }\n\n /**\n * Reject batch of Cloud Events.\n *\n * @param lockTokens - Lock Tokens\n * @param topicName - Topic Name\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to reject\n *\n */\n rejectCloudEvents(\n lockTokens: string[],\n topicName: string,\n eventSubscriptionName: string,\n options: RejectCloudEventsOptions = { requestOptions: {} },\n ): Promise<RejectResult> {\n return this._client.rejectCloudEvents(\n topicName,\n eventSubscriptionName,\n { lockTokens },\n options,\n );\n }\n\n /**\n * Renew lock for batch of Cloud Events.\n *\n * @param lockTokens - Lock Tokens\n * @param topicName - Topic Name\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to renew\n */\n renewCloudEventLocks(\n lockTokens: string[],\n topicName: string,\n eventSubscriptionName: string,\n options: RenewCloudEventLocksOptions = { requestOptions: {} },\n ): Promise<RenewCloudEventLocksResult> {\n return this._client.renewCloudEventLocks(\n topicName,\n eventSubscriptionName,\n { lockTokens },\n options,\n );\n }\n}\n\nexport function convertCloudEventToModelType<T>(event: CloudEvent<T>): CloudEventWireModel {\n if (event.extensionAttributes) {\n for (const propName in event.extensionAttributes) {\n // Per the cloud events spec: \"CloudEvents attribute names MUST consist of lower-case letters ('a' to 'z') or digits ('0' to '9') from the ASCII character set\"\n // they also can not match an existing defined property name.\n\n if (\n !/^[a-z0-9]*$/.test(propName) ||\n cloudEventReservedPropertyNames.indexOf(propName) !== -1\n ) {\n throw new Error(`invalid extension attribute name: ${propName}`);\n }\n }\n }\n\n const converted: CloudEventWireModel = {\n specversion: event.specversion ?? \"1.0\",\n type: event.type,\n source: event.source,\n id: event.id ?? randomUUID(),\n time: event.time ?? new Date(),\n subject: event.subject,\n dataschema: event.dataschema,\n ...(event.extensionAttributes ?? []),\n };\n\n if (event.data instanceof Uint8Array) {\n if (!event.datacontenttype) {\n throw new Error(\n \"a data content type must be provided when sending an event with binary data\",\n );\n }\n\n converted.datacontenttype = event.datacontenttype;\n converted.dataBase64 = event.data;\n } else {\n converted.datacontenttype =\n event.datacontenttype ?? \"application/cloudevents+json; charset=utf-8\";\n converted.data = event.data;\n }\n\n return converted;\n}\n"],"names":["createClientLogger","getClient","isKeyCredential","operationOptionsToRequestParameters","uint8ArrayToString","_publishCloudEventDeserialize","create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GAAA,KAAK,CAAC,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,IAAI,IAAI,EAAE,EAC9B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,UAAU,EAAE,KAAK,CAAC,UAAU,KACxB,CAAA,EAAA,GAAA,KAAK,CAAC,mBAAmB,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,EAAE,EACpC,CAAC;AAEF,IAAA,IAAI,KAAK,CAAC,IAAI,YAAY,UAAU,EAAE;AACpC,QAAA,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;AAC1B,YAAA,MAAM,IAAI,KAAK,CACb,6EAA6E,CAC9E,CAAC;SACH;AAED,QAAA,SAAS,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;AAClD,QAAA,SAAS,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;KACnC;SAAM;AACL,QAAA,SAAS,CAAC,eAAe;AACvB,YAAA,CAAA,EAAA,GAAA,KAAK,CAAC,eAAe,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,6CAA6C,CAAC;AACzE,QAAA,SAAS,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;KAC7B;AAED,IAAA,OAAO,SAAS,CAAC;AACnB;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/cadl-generated/logger.ts","../src/cadl-generated/rest/eventGridClient.ts","../src/cadl-generated/rest/isUnexpected.ts","../src/cadl-generated/api/EventGridContext.ts","../src/cadl-generated/api/operations.ts","../src/cadl-generated/EventGridClient.ts","../src/models.ts","../src/eventGridNamespacesPublishBinaryMode.ts","../src/eventGridNamespacesClient.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"eventgrid-namespaces\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"../logger\";\nimport { TokenCredential, KeyCredential, isKeyCredential } from \"@azure/core-auth\";\nimport { EventGridContext } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of `EventGridContext`\n * @param endpoint - The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential | KeyCredential,\n options: ClientOptions = {},\n): EventGridContext {\n const baseUrl = options.baseUrl ?? `${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"2023-10-01-preview\";\n const userAgentInfo = `azsdk-js-eventgrid-namespaces-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://eventgrid.azure.net/.default\"],\n apiKeyHeaderName: \"Authorization\",\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as EventGridContext;\n\n if (isKeyCredential(credentials)) {\n client.pipeline.addPolicy({\n name: \"customKeyCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", \"SharedAccessKey \" + credentials.key);\n return next(request);\n },\n });\n }\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PublishCloudEvent200Response,\n PublishCloudEvents200Response,\n PublishCloudEventDefaultResponse,\n ReceiveCloudEvents200Response,\n ReceiveCloudEventsDefaultResponse,\n AcknowledgeCloudEvents200Response,\n AcknowledgeCloudEventsDefaultResponse,\n ReleaseCloudEvents200Response,\n ReleaseCloudEventsDefaultResponse,\n RejectCloudEvents200Response,\n RejectCloudEventsDefaultResponse,\n RenewCloudEventLocks200Response,\n RenewCloudEventLocksDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"POST /topics/{topicName}:publish\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject\": [\"200\"],\n \"POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | PublishCloudEvent200Response\n | PublishCloudEvents200Response\n | PublishCloudEventDefaultResponse,\n): response is PublishCloudEventDefaultResponse;\nexport function isUnexpected(\n response: ReceiveCloudEvents200Response | ReceiveCloudEventsDefaultResponse,\n): response is ReceiveCloudEventsDefaultResponse;\nexport function isUnexpected(\n response: AcknowledgeCloudEvents200Response | AcknowledgeCloudEventsDefaultResponse,\n): response is AcknowledgeCloudEventsDefaultResponse;\nexport function isUnexpected(\n response: ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse,\n): response is ReleaseCloudEventsDefaultResponse;\nexport function isUnexpected(\n response: RejectCloudEvents200Response | RejectCloudEventsDefaultResponse,\n): response is RejectCloudEventsDefaultResponse;\nexport function isUnexpected(\n response: RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse,\n): response is RenewCloudEventLocksDefaultResponse;\nexport function isUnexpected(\n response:\n | PublishCloudEvent200Response\n | PublishCloudEvents200Response\n | PublishCloudEventDefaultResponse\n | ReceiveCloudEvents200Response\n | ReceiveCloudEventsDefaultResponse\n | AcknowledgeCloudEvents200Response\n | AcknowledgeCloudEventsDefaultResponse\n | ReleaseCloudEvents200Response\n | ReleaseCloudEventsDefaultResponse\n | RejectCloudEvents200Response\n | RejectCloudEventsDefaultResponse\n | RenewCloudEventLocks200Response\n | RenewCloudEventLocksDefaultResponse,\n): response is\n | PublishCloudEventDefaultResponse\n | ReceiveCloudEventsDefaultResponse\n | AcknowledgeCloudEventsDefaultResponse\n | ReleaseCloudEventsDefaultResponse\n | RejectCloudEventsDefaultResponse\n | RenewCloudEventLocksDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport { EventGridContext } from \"../rest/index\";\nimport getClient from \"../rest/index\";\n\nexport interface EventGridClientOptions extends ClientOptions {}\n\nexport { EventGridContext } from \"../rest/index\";\n\n/** Azure Messaging EventGrid Client */\nexport function createEventGrid(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options: EventGridClientOptions = {},\n): EventGridContext {\n const clientContext = getClient(endpoint, credential, options);\n return clientContext;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n AcknowledgeOptions,\n AcknowledgeResult,\n ReleaseOptions,\n ReleaseResult,\n RejectOptions,\n RejectResult,\n RenewLockOptions,\n RenewCloudEventLocksResult,\n} from \"../models/models\";\nimport {\n isUnexpected,\n EventGridContext as Client,\n AcknowledgeCloudEvents200Response,\n AcknowledgeCloudEventsDefaultResponse,\n PublishCloudEvent200Response,\n PublishCloudEventDefaultResponse,\n PublishCloudEvents200Response,\n PublishCloudEventsDefaultResponse,\n ReceiveCloudEvents200Response,\n ReceiveCloudEventsDefaultResponse,\n RejectCloudEvents200Response,\n RejectCloudEventsDefaultResponse,\n ReleaseCloudEvents200Response,\n ReleaseCloudEventsDefaultResponse,\n RenewCloudEventLocks200Response,\n RenewCloudEventLocksDefaultResponse,\n} from \"../rest/index\";\nimport {\n StreamableMethod,\n operationOptionsToRequestParameters,\n createRestError,\n} from \"@azure-rest/core-client\";\nimport { uint8ArrayToString, stringToUint8Array } from \"@azure/core-util\";\nimport {\n PublishCloudEventOptions,\n PublishCloudEventsOptions,\n ReceiveCloudEventsOptions,\n AcknowledgeCloudEventsOptions,\n ReleaseCloudEventsOptions,\n RejectCloudEventsOptions,\n RenewCloudEventLocksOptions,\n} from \"../models/options\";\n\nexport function _publishCloudEventSend(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n): StreamableMethod<PublishCloudEvent200Response | PublishCloudEventDefaultResponse> {\n return context.path(\"/topics/{topicName}:publish\", topicName).post({\n ...operationOptionsToRequestParameters(options),\n contentType: (options.contentType as any) ?? \"application/cloudevents+json; charset=utf-8\",\n body: {\n id: event[\"id\"],\n source: event[\"source\"],\n data: event[\"data\"],\n data_base64:\n event[\"dataBase64\"] !== undefined\n ? uint8ArrayToString(event[\"dataBase64\"], \"base64\")\n : undefined,\n type: event[\"type\"],\n time: event[\"time\"]?.toISOString(),\n specversion: event[\"specversion\"],\n dataschema: event[\"dataschema\"],\n datacontenttype: event[\"datacontenttype\"],\n subject: event[\"subject\"],\n },\n }) as StreamableMethod<PublishCloudEvent200Response | PublishCloudEventDefaultResponse>;\n}\n\nexport async function _publishCloudEventDeserialize(\n result: PublishCloudEvent200Response | PublishCloudEventDefaultResponse,\n): Promise<PublishResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return result.body;\n}\n\n/** Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. */\nexport async function publishCloudEvent(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n): Promise<PublishResult> {\n const result = await _publishCloudEventSend(context, topicName, event, options);\n return _publishCloudEventDeserialize(result);\n}\n\nexport function _publishCloudEventsSend(\n context: Client,\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<PublishCloudEvents200Response | PublishCloudEventsDefaultResponse> {\n return context.path(\"/topics/{topicName}:publish\", topicName).post({\n ...operationOptionsToRequestParameters(options),\n contentType:\n (options.contentType as any) ?? \"application/cloudevents-batch+json; charset=utf-8\",\n body: (events ?? []).map((p) => {\n return {\n id: p[\"id\"],\n source: p[\"source\"],\n data: p[\"data\"],\n data_base64:\n p[\"dataBase64\"] !== undefined ? uint8ArrayToString(p[\"dataBase64\"], \"base64\") : undefined,\n type: p[\"type\"],\n time: p[\"time\"]?.toISOString(),\n specversion: p[\"specversion\"],\n dataschema: p[\"dataschema\"],\n datacontenttype: p[\"datacontenttype\"],\n subject: p[\"subject\"],\n };\n }),\n }) as StreamableMethod<PublishCloudEvents200Response | PublishCloudEventsDefaultResponse>;\n}\n\nexport async function _publishCloudEventsDeserialize(\n result: PublishCloudEvents200Response | PublishCloudEventsDefaultResponse,\n): Promise<PublishResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return result.body;\n}\n\n/** Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. */\nexport async function publishCloudEvents(\n context: Client,\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptions = { requestOptions: {} },\n): Promise<PublishResult> {\n const result = await _publishCloudEventsSend(context, topicName, events, options);\n return _publishCloudEventsDeserialize(result);\n}\n\nexport function _receiveCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<ReceiveCloudEvents200Response | ReceiveCloudEventsDefaultResponse> {\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n queryParameters: {\n maxEvents: options?.maxEvents,\n maxWaitTime: options?.maxWaitTime,\n },\n });\n}\n\nexport async function _receiveCloudEventsDeserialize(\n result: ReceiveCloudEvents200Response | ReceiveCloudEventsDefaultResponse,\n): Promise<ReceiveResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n value: result.body[\"value\"].map((p) => ({\n brokerProperties: {\n lockToken: p.brokerProperties[\"lockToken\"],\n deliveryCount: p.brokerProperties[\"deliveryCount\"],\n },\n event: {\n id: p.event[\"id\"],\n source: p.event[\"source\"],\n data: p.event[\"data\"],\n dataBase64:\n typeof p.event[\"data_base64\"] === \"string\"\n ? stringToUint8Array(p.event[\"data_base64\"], \"base64\")\n : p.event[\"data_base64\"],\n type: p.event[\"type\"],\n time: p.event[\"time\"] !== undefined ? new Date(p.event[\"time\"]) : undefined,\n specversion: p.event[\"specversion\"],\n dataschema: p.event[\"dataschema\"],\n datacontenttype: p.event[\"datacontenttype\"],\n subject: p.event[\"subject\"],\n },\n })),\n };\n}\n\n/** Receive Batch of Cloud Events from the Event Subscription. */\nexport async function receiveCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptions = { requestOptions: {} },\n): Promise<ReceiveResult> {\n const result = await _receiveCloudEventsSend(context, topicName, eventSubscriptionName, options);\n return _receiveCloudEventsDeserialize(result);\n}\n\nexport function _acknowledgeCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n acknowledgeOptions: AcknowledgeOptions,\n options: AcknowledgeCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<AcknowledgeCloudEvents200Response | AcknowledgeCloudEventsDefaultResponse> {\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n body: { lockTokens: acknowledgeOptions[\"lockTokens\"] },\n });\n}\n\nexport async function _acknowledgeCloudEventsDeserialize(\n result: AcknowledgeCloudEvents200Response | AcknowledgeCloudEventsDefaultResponse,\n): Promise<AcknowledgeResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n failedLockTokens: result.body[\"failedLockTokens\"].map((p) => ({\n lockToken: p[\"lockToken\"],\n error: p.error,\n })),\n succeededLockTokens: result.body[\"succeededLockTokens\"],\n };\n}\n\n/** Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer. */\nexport async function acknowledgeCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n acknowledgeOptions: AcknowledgeOptions,\n options: AcknowledgeCloudEventsOptions = { requestOptions: {} },\n): Promise<AcknowledgeResult> {\n const result = await _acknowledgeCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n acknowledgeOptions,\n options,\n );\n return _acknowledgeCloudEventsDeserialize(result);\n}\n\nexport function _releaseCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n releaseOptions: ReleaseOptions,\n options: ReleaseCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse> {\n let releaseDelayInSeconds: number | undefined = undefined;\n if (options?.releaseDelayInSeconds) {\n releaseDelayInSeconds = parseInt(options.releaseDelayInSeconds);\n }\n\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n queryParameters: {\n releaseDelayInSeconds,\n },\n body: { lockTokens: releaseOptions[\"lockTokens\"] },\n });\n}\n\nexport async function _releaseCloudEventsDeserialize(\n result: ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse,\n): Promise<ReleaseResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n failedLockTokens: result.body[\"failedLockTokens\"].map((p) => ({\n lockToken: p[\"lockToken\"],\n error: p.error,\n })),\n succeededLockTokens: result.body[\"succeededLockTokens\"],\n };\n}\n\n/** Release batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information. */\nexport async function releaseCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n releaseOptions: ReleaseOptions,\n options: ReleaseCloudEventsOptions = { requestOptions: {} },\n): Promise<ReleaseResult> {\n const result = await _releaseCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n releaseOptions,\n options,\n );\n return _releaseCloudEventsDeserialize(result);\n}\n\nexport function _rejectCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n rejectOptions: RejectOptions,\n options: RejectCloudEventsOptions = { requestOptions: {} },\n): StreamableMethod<RejectCloudEvents200Response | RejectCloudEventsDefaultResponse> {\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n body: { lockTokens: rejectOptions[\"lockTokens\"] },\n });\n}\n\nexport async function _rejectCloudEventsDeserialize(\n result: RejectCloudEvents200Response | RejectCloudEventsDefaultResponse,\n): Promise<RejectResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n failedLockTokens: result.body[\"failedLockTokens\"].map((p) => ({\n lockToken: p[\"lockToken\"],\n error: p.error,\n })),\n succeededLockTokens: result.body[\"succeededLockTokens\"],\n };\n}\n\n/** Reject batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully rejected lockTokens, along with other failed lockTokens with their corresponding error information. */\nexport async function rejectCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n rejectOptions: RejectOptions,\n options: RejectCloudEventsOptions = { requestOptions: {} },\n): Promise<RejectResult> {\n const result = await _rejectCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n rejectOptions,\n options,\n );\n return _rejectCloudEventsDeserialize(result);\n}\n\nexport function _renewCloudEventLocksSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n renewLockOptions: RenewLockOptions,\n options: RenewCloudEventLocksOptions = { requestOptions: {} },\n): StreamableMethod<RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse> {\n return context\n .path(\n \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock\",\n topicName,\n eventSubscriptionName,\n )\n .post({\n ...operationOptionsToRequestParameters(options),\n body: { lockTokens: renewLockOptions[\"lockTokens\"] },\n });\n}\n\nexport async function _renewCloudEventLocksDeserialize(\n result: RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse,\n): Promise<RenewCloudEventLocksResult> {\n if (isUnexpected(result)) {\n throw createRestError(result);\n }\n\n return {\n failedLockTokens: result.body[\"failedLockTokens\"].map((p) => ({\n lockToken: p[\"lockToken\"],\n error: p.error,\n })),\n succeededLockTokens: result.body[\"succeededLockTokens\"],\n };\n}\n\n/** Renew lock for batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully renewed lockTokens, along with other failed lockTokens with their corresponding error information. */\nexport async function renewCloudEventLocks(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n renewLockOptions: RenewLockOptions,\n options: RenewCloudEventLocksOptions = { requestOptions: {} },\n): Promise<RenewCloudEventLocksResult> {\n const result = await _renewCloudEventLocksSend(\n context,\n topicName,\n eventSubscriptionName,\n renewLockOptions,\n options,\n );\n return _renewCloudEventLocksDeserialize(result);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TokenCredential, KeyCredential } from \"@azure/core-auth\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n AcknowledgeOptions,\n AcknowledgeResult,\n ReleaseOptions,\n ReleaseResult,\n RejectOptions,\n RejectResult,\n RenewLockOptions,\n RenewCloudEventLocksResult,\n} from \"./models/models\";\nimport {\n PublishCloudEventOptions,\n PublishCloudEventsOptions,\n ReceiveCloudEventsOptions,\n AcknowledgeCloudEventsOptions,\n ReleaseCloudEventsOptions,\n RejectCloudEventsOptions,\n RenewCloudEventLocksOptions,\n} from \"./models/options\";\nimport {\n createEventGrid,\n EventGridClientOptions,\n EventGridContext,\n publishCloudEvent,\n publishCloudEvents,\n receiveCloudEvents,\n acknowledgeCloudEvents,\n releaseCloudEvents,\n rejectCloudEvents,\n renewCloudEventLocks,\n} from \"./api/index\";\n\nexport { EventGridClientOptions } from \"./api/EventGridContext\";\n\nexport class EventGridClient {\n private _client: EventGridContext;\n\n getClient(): EventGridContext {\n return this._client;\n }\n\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n /** Azure Messaging EventGrid Client */\n constructor(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options: EventGridClientOptions = {},\n ) {\n this._client = createEventGrid(endpoint, credential, options);\n this.pipeline = this._client.pipeline;\n }\n\n /** Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. */\n publishCloudEvent(\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n ): Promise<PublishResult> {\n return publishCloudEvent(this._client, topicName, event, options);\n }\n\n /** Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return various error codes. For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for internal server error. */\n publishCloudEvents(\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptions = { requestOptions: {} },\n ): Promise<PublishResult> {\n return publishCloudEvents(this._client, topicName, events, options);\n }\n\n /** Receive Batch of Cloud Events from the Event Subscription. */\n receiveCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptions = { requestOptions: {} },\n ): Promise<ReceiveResult> {\n return receiveCloudEvents(this._client, topicName, eventSubscriptionName, options);\n }\n\n /** Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully acknowledged lockTokens, along with other failed lockTokens with their corresponding error information. Successfully acknowledged events will no longer be available to any consumer. */\n acknowledgeCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n acknowledgeOptions: AcknowledgeOptions,\n options: AcknowledgeCloudEventsOptions = { requestOptions: {} },\n ): Promise<AcknowledgeResult> {\n return acknowledgeCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n acknowledgeOptions,\n options,\n );\n }\n\n /** Release batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully released lockTokens, along with other failed lockTokens with their corresponding error information. */\n releaseCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n releaseOptions: ReleaseOptions,\n options: ReleaseCloudEventsOptions = { requestOptions: {} },\n ): Promise<ReleaseResult> {\n return releaseCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n releaseOptions,\n options,\n );\n }\n\n /** Reject batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully rejected lockTokens, along with other failed lockTokens with their corresponding error information. */\n rejectCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n rejectOptions: RejectOptions,\n options: RejectCloudEventsOptions = { requestOptions: {} },\n ): Promise<RejectResult> {\n return rejectCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n rejectOptions,\n options,\n );\n }\n\n /** Renew lock for batch of Cloud Events. The server responds with an HTTP 200 status code if the request is successfully accepted. The response body will include the set of successfully renewed lockTokens, along with other failed lockTokens with their corresponding error information. */\n renewCloudEventLocks(\n topicName: string,\n eventSubscriptionName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n renewLockOptions: RenewLockOptions,\n options: RenewCloudEventLocksOptions = { requestOptions: {} },\n ): Promise<RenewCloudEventLocksResult> {\n return renewCloudEventLocks(\n this._client,\n topicName,\n eventSubscriptionName,\n renewLockOptions,\n options,\n );\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { OperationOptions } from \"@azure-rest/core-client\";\n\nexport interface PublishCloudEventOptions extends OperationOptions {\n /** binary mode */\n binaryMode?: boolean;\n\n /** content type */\n contentType?: string;\n}\n\n/**\n * An event in the Cloud Event 1.0 schema.\n */\nexport interface CloudEvent<T> {\n /**\n * Type of event related to the originating occurrence.\n */\n type: string;\n /**\n * Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event.\n */\n source: string;\n /**\n * An identifier for the event. The combination of id and source must be unique for each distinct event.\n */\n id: string;\n /**\n * The time the event was generated.\n */\n time?: Date;\n /**\n * Identifies the schema that data adheres to.\n */\n dataschema?: string;\n /**\n * Content type of data value.\n */\n datacontenttype?: string;\n /**\n * Event data specific to the event type.\n */\n data?: T;\n /**\n * This describes the subject of the event in the context of the event producer (identified by source).\n */\n subject?: string;\n /**\n * Additional context attributes for the event. The Cloud Event specification refers to these as \"extension attributes\".\n */\n extensionAttributes?: Record<string, unknown>;\n /**\n * The version of the CloudEvents specification which the event uses.\n */\n specversion?: string | \"1.0\";\n}\n\nexport const cloudEventReservedPropertyNames = [\n \"specversion\",\n \"id\",\n \"source\",\n \"type\",\n \"datacontenttype\",\n \"dataschema\",\n \"subject\",\n \"time\",\n \"data\",\n];\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n isUnexpected,\n EventGridContext as Client,\n PublishCloudEvent200Response,\n PublishCloudEventDefaultResponse,\n} from \"./cadl-generated/rest/index\";\nimport { StreamableMethod, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport { PublishCloudEventOptions } from \"./cadl-generated/models/options\";\nimport { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport { Buffer } from \"buffer\";\nimport { CloudEvent } from \"./cadl-generated\";\n\nexport async function publishCloudEventInBinaryMode(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n): Promise<Record<string, any>> {\n const result = await _publishCloudEventSendBinaryMode(context, topicName, event, options);\n return _publishCloudEventDeserialize(result);\n}\n\nexport async function _publishCloudEventDeserialize(\n result: PublishCloudEvent200Response | PublishCloudEventDefaultResponse,\n): Promise<Record<string, any>> {\n if (isUnexpected(result)) {\n throw result.body;\n }\n\n return result.body;\n}\n\nexport function _publishCloudEventSendBinaryMode(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptions = { requestOptions: {} },\n): StreamableMethod<PublishCloudEvent200Response | PublishCloudEventDefaultResponse> {\n const headers: RawHttpHeadersInput = {\n \"ce-id\": event.id,\n \"ce-source\": event.source,\n \"ce-type\": event.type,\n \"ce-specversion\": event.specversion,\n };\n\n if (event.time) {\n headers[\"ce-time\"] = event.time.toISOString();\n }\n\n if (event.dataschema) {\n headers[\"ce-dataschema\"] = event.dataschema;\n }\n\n if (event.datacontenttype) {\n headers[\"ce-datacontenttype\"] = event.datacontenttype;\n }\n\n if (event.subject) {\n headers[\"ce-subject\"] = event.subject;\n }\n\n let data: any;\n if (event.data) {\n // If data is already encoded\n if (Buffer.isBuffer(event.data)) {\n data = event.data;\n } else {\n throw new Error(`CloudEvent data must be binary when in binary mode.`);\n }\n } else {\n if (event.dataBase64) {\n data = event.dataBase64;\n }\n }\n\n return context.path(\"/topics/{topicName}:publish\", topicName).post({\n ...operationOptionsToRequestParameters(options),\n contentType: (options.contentType as any) ?? \"application/cloudevents+json; charset=utf-8\",\n headers,\n body: {\n id: event.id,\n source: event.source,\n data,\n type: event.type,\n time: event.time?.toISOString(),\n specversion: event.specversion,\n dataschema: event.dataschema,\n datacontenttype: event.datacontenttype,\n subject: event.subject,\n },\n });\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AzureKeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport {\n ReceiveResult,\n AcknowledgeResult,\n ReleaseResult,\n RejectResult,\n PublishCloudEventsOptions,\n ReceiveCloudEventsOptions,\n AcknowledgeCloudEventsOptions,\n ReleaseCloudEventsOptions,\n RejectCloudEventsOptions,\n RenewCloudEventLocksOptions,\n RenewCloudEventLocksResult,\n CloudEvent as CloudEventWireModel,\n} from \"./cadl-generated/models\";\nimport { randomUUID } from \"@azure/core-util\";\nimport { EventGridClient as EventGridClientGenerated } from \"./cadl-generated/EventGridClient\";\nimport { EventGridClientOptions } from \"./cadl-generated/api\";\nimport { PublishCloudEventOptions, CloudEvent, cloudEventReservedPropertyNames } from \"./models\";\nimport { publishCloudEventInBinaryMode } from \"./eventGridNamespacesPublishBinaryMode\";\n\n/**\n * Event Grid Namespaces Client\n */\nexport class EventGridNamespacesClient {\n private _client: EventGridClientGenerated;\n\n /** Azure Messaging EventGrid Client */\n constructor(\n endpoint: string,\n credential: AzureKeyCredential | TokenCredential,\n options: EventGridClientOptions = {},\n ) {\n // credential.update(`SharedAccessKey ${credential.key}`);\n this._client = new EventGridClientGenerated(endpoint, credential, options);\n }\n\n /**\n * Publish Single Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200\n * status code with an empty JSON object in response. Otherwise, the server can return various error codes.\n * For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message\n * is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for\n * internal server error.\n *\n * @param event - Event to publish\n * @param topicName - Topic to publish the event\n * @param options - Options to publish\n *\n */\n async publishCloudEvent<T>(\n event: CloudEvent<T>,\n topicName: string,\n options: PublishCloudEventOptions = { requestOptions: {} },\n ): Promise<void> {\n const cloudEventWireModel: CloudEventWireModel = convertCloudEventToModelType(event);\n\n if (!options.binaryMode) {\n await this._client.publishCloudEvent(topicName, cloudEventWireModel, options);\n } else {\n await publishCloudEventInBinaryMode(\n this._client.getClient(),\n topicName,\n cloudEventWireModel,\n {\n contentType: options.contentType,\n ...options,\n },\n );\n }\n }\n\n /**\n * Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an HTTP 200\n * status code with an empty JSON object in response. Otherwise, the server can return various error codes.\n * For example, 401: which indicates authorization failure, 403: which indicates quota exceeded or message\n * is too large, 410: which indicates that specific topic is not found, 400: for bad request, and 500: for\n * internal server error.\n *\n * @param events - Events to publish\n * @param topicName - Topic to publish the event\n * @param options - Options to publish\n *\n */\n async publishCloudEvents<T>(\n events: CloudEvent<T>[],\n topicName: string,\n options: PublishCloudEventsOptions = { requestOptions: {} },\n ): Promise<void> {\n const eventsWireModel: Array<CloudEventWireModel> = [];\n for (const individualevent of events) {\n eventsWireModel.push(convertCloudEventToModelType(individualevent));\n }\n await this._client.publishCloudEvents(topicName, eventsWireModel, options);\n }\n\n /**\n * Receive Batch of Cloud Events from the Event Subscription.\n *\n * @param topicName - Topic to receive\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to receive\n *\n */\n receiveCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptions = { requestOptions: {} },\n ): Promise<ReceiveResult> {\n return this._client.receiveCloudEvents(topicName, eventSubscriptionName, options);\n }\n\n /**\n * Acknowledge batch of Cloud Events. The server responds with an HTTP 200 status code if at least one\n * event is successfully acknowledged. The response body will include the set of successfully acknowledged\n * lockTokens, along with other failed lockTokens with their corresponding error information. Successfully\n * acknowledged events will no longer be available to any consumer.\n *\n * @param lockTokens - Lock Tokens\n * @param topicName - Topic Name\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to Acknowledge\n *\n */\n acknowledgeCloudEvents(\n lockTokens: string[],\n topicName: string,\n eventSubscriptionName: string,\n options: AcknowledgeCloudEventsOptions = { requestOptions: {} },\n ): Promise<AcknowledgeResult> {\n return this._client.acknowledgeCloudEvents(\n topicName,\n eventSubscriptionName,\n { lockTokens },\n options,\n );\n }\n\n /**\n * Release batch of Cloud Events. The server responds with an HTTP 200 status code if at least one event is\n * successfully released. The response body will include the set of successfully released lockTokens, along\n * with other failed lockTokens with their corresponding error information.\n *\n * @param lockTokens - Lock Tokens\n * @param topicName - Topic Name\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to release\n *\n */\n releaseCloudEvents(\n lockTokens: string[],\n topicName: string,\n eventSubscriptionName: string,\n options: ReleaseCloudEventsOptions = { requestOptions: {} },\n ): Promise<ReleaseResult> {\n return this._client.releaseCloudEvents(\n topicName,\n eventSubscriptionName,\n { lockTokens },\n options,\n );\n }\n\n /**\n * Reject batch of Cloud Events.\n *\n * @param lockTokens - Lock Tokens\n * @param topicName - Topic Name\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to reject\n *\n */\n rejectCloudEvents(\n lockTokens: string[],\n topicName: string,\n eventSubscriptionName: string,\n options: RejectCloudEventsOptions = { requestOptions: {} },\n ): Promise<RejectResult> {\n return this._client.rejectCloudEvents(\n topicName,\n eventSubscriptionName,\n { lockTokens },\n options,\n );\n }\n\n /**\n * Renew lock for batch of Cloud Events.\n *\n * @param lockTokens - Lock Tokens\n * @param topicName - Topic Name\n * @param eventSubscriptionName - Name of the Event Subscription\n * @param options - Options to renew\n */\n renewCloudEventLocks(\n lockTokens: string[],\n topicName: string,\n eventSubscriptionName: string,\n options: RenewCloudEventLocksOptions = { requestOptions: {} },\n ): Promise<RenewCloudEventLocksResult> {\n return this._client.renewCloudEventLocks(\n topicName,\n eventSubscriptionName,\n { lockTokens },\n options,\n );\n }\n}\n\nexport function convertCloudEventToModelType<T>(event: CloudEvent<T>): CloudEventWireModel {\n if (event.extensionAttributes) {\n for (const propName in event.extensionAttributes) {\n // Per the cloud events spec: \"CloudEvents attribute names MUST consist of lower-case letters ('a' to 'z') or digits ('0' to '9') from the ASCII character set\"\n // they also can not match an existing defined property name.\n\n if (\n !/^[a-z0-9]*$/.test(propName) ||\n cloudEventReservedPropertyNames.indexOf(propName) !== -1\n ) {\n throw new Error(`invalid extension attribute name: ${propName}`);\n }\n }\n }\n\n const converted: CloudEventWireModel = {\n specversion: event.specversion ?? \"1.0\",\n type: event.type,\n source: event.source,\n id: event.id ?? randomUUID(),\n time: event.time ?? new Date(),\n subject: event.subject,\n dataschema: event.dataschema,\n ...(event.extensionAttributes ?? []),\n };\n\n if (event.data instanceof Uint8Array) {\n if (!event.datacontenttype) {\n throw new Error(\n \"a data content type must be provided when sending an event with binary data\",\n );\n }\n\n converted.datacontenttype = event.datacontenttype;\n converted.dataBase64 = event.data;\n } else {\n converted.datacontenttype =\n event.datacontenttype ?? \"application/cloudevents+json; charset=utf-8\";\n converted.data = event.data;\n }\n\n return converted;\n}\n"],"names":["createClientLogger","getClient","isKeyCredential","operationOptionsToRequestParameters","uint8ArrayToString","_publishCloudEventDeserialize","createRestError","stringToUint8Array","Buffer","EventGridClientGenerated","randomUUID"],"mappings":";;;;;;;;;;;AAAA;AACA;AAGO,MAAM,MAAM,GAAGA,2BAAkB,CAAC,sBAAsB,CAAC;;ACJhE;AACA;AAOA;;;;;AAKG;AACW,SAAU,YAAY,CAClC,QAAgB,EAChB,WAA4C,EAC5C,OAAA,GAAyB,EAAE,EAAA;;IAE3B,MAAM,OAAO,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,OAAO,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,CAAA,EAAG,QAAQ,CAAA,CAAE,CAAC;IACjD,OAAO,CAAC,UAAU,GAAG,CAAA,EAAA,GAAA,OAAO,CAAC,UAAU,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,oBAAoB,CAAC;IAChE,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,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;KACnC;SAAM;AACL,QAAA,SAAS,CAAC,eAAe;AACvB,YAAA,CAAA,EAAA,GAAA,KAAK,CAAC,eAAe,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,6CAA6C,CAAC;AACzE,QAAA,SAAS,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;KAC7B;AAED,IAAA,OAAO,SAAS,CAAC;AACnB;;;;;;;;;;;;"}
@@ -2,4 +2,5 @@
2
2
  // Licensed under the MIT license.
3
3
  export { AzureKeyCredential } from "@azure/core-auth";
4
4
  export { EventGridNamespacesClient as EventGridClient } from "./eventGridNamespacesClient";
5
+ export { EventGridDeserializer } from "@azure/eventgrid";
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAoBtD,OAAO,EAAE,yBAAyB,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\n\nexport {\n ReceiveResult,\n ReceiveDetails,\n BrokerProperties,\n AcknowledgeResult,\n FailedLockToken,\n ReleaseResult,\n RejectResult,\n PublishCloudEventsOptions,\n ReceiveCloudEventsOptions,\n AcknowledgeCloudEventsOptions,\n ReleaseCloudEventsOptions,\n RejectCloudEventsOptions,\n ReleaseDelay,\n RenewCloudEventLocksOptions,\n RenewCloudEventLocksResult,\n} from \"./cadl-generated/models\";\n\nexport { EventGridNamespacesClient as EventGridClient } from \"./eventGridNamespacesClient\";\n\nexport { EventGridClientOptions } from \"./cadl-generated\";\n\nexport { PublishResultOutput } from \"./cadl-generated/rest\";\n\nexport { OperationOptions } from \"@azure-rest/core-client\";\n\nexport { CloudEvent, PublishCloudEventOptions } from \"./models\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAoBtD,OAAO,EAAE,yBAAyB,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAU3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\n\nexport {\n ReceiveResult,\n ReceiveDetails,\n BrokerProperties,\n AcknowledgeResult,\n FailedLockToken,\n ReleaseResult,\n RejectResult,\n PublishCloudEventsOptions,\n ReceiveCloudEventsOptions,\n AcknowledgeCloudEventsOptions,\n ReleaseCloudEventsOptions,\n RejectCloudEventsOptions,\n ReleaseDelay,\n RenewCloudEventLocksOptions,\n RenewCloudEventLocksResult,\n} from \"./cadl-generated/models\";\n\nexport { EventGridNamespacesClient as EventGridClient } from \"./eventGridNamespacesClient\";\n\nexport { EventGridClientOptions } from \"./cadl-generated\";\n\nexport { PublishResultOutput } from \"./cadl-generated/rest\";\n\nexport { OperationOptions } from \"@azure-rest/core-client\";\n\nexport { CloudEvent, PublishCloudEventOptions } from \"./models\";\n\nexport { EventGridDeserializer } from \"@azure/eventgrid\";\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "An isomorphic client library for the Azure Event Grid service.",
6
- "version": "1.0.0-beta.1",
6
+ "version": "1.0.0-beta.2",
7
7
  "keywords": [
8
8
  "node",
9
9
  "azure",
@@ -76,6 +76,7 @@
76
76
  "@azure-rest/core-client": "^1.3.1",
77
77
  "@azure/logger": "^1.0.0",
78
78
  "@azure/core-util": "^1.6.1",
79
+ "@azure/eventgrid": "^5.4.0",
79
80
  "buffer": "^6.0.0",
80
81
  "tslib": "^2.2.0"
81
82
  },
@@ -1,6 +1,7 @@
1
1
  import { AzureKeyCredential } from '@azure/core-auth';
2
2
  import { ClientOptions } from '@azure-rest/core-client';
3
3
  import { ErrorModel } from '@azure-rest/core-client';
4
+ import { EventGridDeserializer } from '@azure/eventgrid';
4
5
  import { OperationOptions } from '@azure-rest/core-client';
5
6
  import { TokenCredential } from '@azure/core-auth';
6
7
 
@@ -186,6 +187,8 @@ export declare class EventGridClient {
186
187
  export declare interface EventGridClientOptions extends ClientOptions {
187
188
  }
188
189
 
190
+ export { EventGridDeserializer }
191
+
189
192
  /** Failed LockToken information. */
190
193
  export declare interface FailedLockToken {
191
194
  /** The lock token of an entry in the request. */
@@ -1,5 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export const DEFAULT_API_VERSION = "2018-01-01";
4
- export const DEFAULT_EVENTGRID_SCOPE = "https://eventgrid.azure.net/.default";
5
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAChD,MAAM,CAAC,MAAM,uBAAuB,GAAG,sCAAsC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport const DEFAULT_API_VERSION = \"2018-01-01\";\nexport const DEFAULT_EVENTGRID_SCOPE = \"https://eventgrid.azure.net/.default\";\n"]}