@azure/eventgrid-namespaces 1.0.1-alpha.20240826.1 → 1.0.1-alpha.20240829.1

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.
Files changed (53) hide show
  1. package/dist/index.js +12 -12
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/src/cadl-generated/EventGridClient.js +1 -1
  4. package/dist-esm/src/cadl-generated/EventGridClient.js.map +1 -1
  5. package/dist-esm/src/cadl-generated/api/EventGridContext.js +1 -1
  6. package/dist-esm/src/cadl-generated/api/EventGridContext.js.map +1 -1
  7. package/dist-esm/src/cadl-generated/api/index.js +1 -1
  8. package/dist-esm/src/cadl-generated/api/index.js.map +1 -1
  9. package/dist-esm/src/cadl-generated/api/operations.js +1 -1
  10. package/dist-esm/src/cadl-generated/api/operations.js.map +1 -1
  11. package/dist-esm/src/cadl-generated/index.js +1 -1
  12. package/dist-esm/src/cadl-generated/index.js.map +1 -1
  13. package/dist-esm/src/cadl-generated/logger.js +1 -1
  14. package/dist-esm/src/cadl-generated/logger.js.map +1 -1
  15. package/dist-esm/src/cadl-generated/models/index.js +1 -1
  16. package/dist-esm/src/cadl-generated/models/index.js.map +1 -1
  17. package/dist-esm/src/cadl-generated/models/models.js +1 -1
  18. package/dist-esm/src/cadl-generated/models/models.js.map +1 -1
  19. package/dist-esm/src/cadl-generated/models/options.js +1 -1
  20. package/dist-esm/src/cadl-generated/models/options.js.map +1 -1
  21. package/dist-esm/src/cadl-generated/rest/clientDefinitions.js +1 -1
  22. package/dist-esm/src/cadl-generated/rest/clientDefinitions.js.map +1 -1
  23. package/dist-esm/src/cadl-generated/rest/eventGridClient.js +1 -1
  24. package/dist-esm/src/cadl-generated/rest/eventGridClient.js.map +1 -1
  25. package/dist-esm/src/cadl-generated/rest/index.js +1 -1
  26. package/dist-esm/src/cadl-generated/rest/index.js.map +1 -1
  27. package/dist-esm/src/cadl-generated/rest/isUnexpected.js +1 -1
  28. package/dist-esm/src/cadl-generated/rest/isUnexpected.js.map +1 -1
  29. package/dist-esm/src/cadl-generated/rest/models.js +1 -1
  30. package/dist-esm/src/cadl-generated/rest/models.js.map +1 -1
  31. package/dist-esm/src/cadl-generated/rest/outputModels.js +1 -1
  32. package/dist-esm/src/cadl-generated/rest/outputModels.js.map +1 -1
  33. package/dist-esm/src/cadl-generated/rest/parameters.js +1 -1
  34. package/dist-esm/src/cadl-generated/rest/parameters.js.map +1 -1
  35. package/dist-esm/src/cadl-generated/rest/responses.js +1 -1
  36. package/dist-esm/src/cadl-generated/rest/responses.js.map +1 -1
  37. package/dist-esm/src/cloudEventDistrubtedTracingEnricherPolicy.js +1 -1
  38. package/dist-esm/src/cloudEventDistrubtedTracingEnricherPolicy.js.map +1 -1
  39. package/dist-esm/src/consumer.js +1 -1
  40. package/dist-esm/src/consumer.js.map +1 -1
  41. package/dist-esm/src/eventGridNamespacesPublishBinaryMode.js +1 -1
  42. package/dist-esm/src/eventGridNamespacesPublishBinaryMode.js.map +1 -1
  43. package/dist-esm/src/eventGridReceiverClient.js +1 -1
  44. package/dist-esm/src/eventGridReceiverClient.js.map +1 -1
  45. package/dist-esm/src/eventGridSenderClient.js +1 -1
  46. package/dist-esm/src/eventGridSenderClient.js.map +1 -1
  47. package/dist-esm/src/index.js +1 -1
  48. package/dist-esm/src/index.js.map +1 -1
  49. package/dist-esm/src/models.js +1 -1
  50. package/dist-esm/src/models.js.map +1 -1
  51. package/dist-esm/src/util.js +1 -1
  52. package/dist-esm/src/util.js.map +1 -1
  53. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/cadl-generated/api/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,OAAO,EACL,YAAY,GAgBb,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,mCAAmC,EACnC,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,kBAAk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ACpD,MAA6E;IAE7E,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO;QACL,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5D,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC;YACzB,KAAK,EAAE,CAAC,CAAC,KAAK;SACf,CAAC,CAAC;QACH,mBAAmB,EAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC;KACxD,CAAC;AACJ,CAAC;AAED,sUAAsU;AACtU,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAe,EACf,SAAiB,EACjB,qBAA6B,EAC7B,UAAoB,EACpB,UAA8C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEpE,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAC5C,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,UAAU,EACV,OAAO,CACR,CAAC;IACF,OAAO,gCAAgC,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n AcknowledgeResult,\n ReleaseResult,\n RejectResult,\n RenewLocksResult,\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 PublishCloudEventOptionalParams,\n PublishCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n RejectCloudEventsOptionalParams,\n RenewCloudEventLocksOptionalParams,\n} from \"../models/options\";\n\nexport function _publishCloudEventSend(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptionalParams = { 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 a single Cloud Event to a namespace topic. */\nexport async function publishCloudEvent(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptionalParams = { 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: PublishCloudEventsOptionalParams = { 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 a batch of Cloud Events to a namespace topic. */\nexport async function publishCloudEvents(\n context: Client,\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptionalParams = { 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: ReceiveCloudEventsOptionalParams = { 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 details: 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 a batch of Cloud Events from a subscription. */\nexport async function receiveCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptionalParams = { 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 lockTokens: string[],\n options: AcknowledgeCloudEventsOptionalParams = { 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: 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 a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. */\nexport async function acknowledgeCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: AcknowledgeCloudEventsOptionalParams = { requestOptions: {} },\n): Promise<AcknowledgeResult> {\n const result = await _acknowledgeCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n return _acknowledgeCloudEventsDeserialize(result);\n}\n\nexport function _releaseCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: ReleaseCloudEventsOptionalParams = { requestOptions: {} },\n): StreamableMethod<ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse> {\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: options?.releaseDelayInSeconds,\n },\n body: { lockTokens: 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 a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. */\nexport async function releaseCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: ReleaseCloudEventsOptionalParams = { requestOptions: {} },\n): Promise<ReleaseResult> {\n const result = await _releaseCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n return _releaseCloudEventsDeserialize(result);\n}\n\nexport function _rejectCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RejectCloudEventsOptionalParams = { 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: 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 a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. */\nexport async function rejectCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RejectCloudEventsOptionalParams = { requestOptions: {} },\n): Promise<RejectResult> {\n const result = await _rejectCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n return _rejectCloudEventsDeserialize(result);\n}\n\nexport function _renewCloudEventLocksSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RenewCloudEventLocksOptionalParams = { 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: lockTokens },\n });\n}\n\nexport async function _renewCloudEventLocksDeserialize(\n result: RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse,\n): Promise<RenewLocksResult> {\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 locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. */\nexport async function renewCloudEventLocks(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RenewCloudEventLocksOptionalParams = { requestOptions: {} },\n): Promise<RenewLocksResult> {\n const result = await _renewCloudEventLocksSend(\n context,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n return _renewCloudEventLocksDeserialize(result);\n}\n"]}
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/cadl-generated/api/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,OAAO,EACL,YAAY,GAgBb,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,mCAAmC,EACnC,eAAe,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAW1E,MAAM,UAAU,sBAAsB,CACpC,OAAe,EACf,SAAiB,EACjB,KAAiB,EACjB,UAA2C,EAAE,cAAc,EAAE,EAAE,EAAE;;IAEjE,OAAO,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAC,IAAI,iCAC7D,mCAAmC,CAAC,OAAO,CAAC,KAC/C,WAAW,EAAE,MAAC,OAAO,CAAC,WAAmB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,EAAE,CAAC,CAAC,KAAK;SACf,CAAC,CAAC;QACH,mBAAmB,EAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC;KACxD,CAAC;AACJ,CAAC;AAED,sUAAsU;AACtU,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAe,EACf,SAAiB,EACjB,qBAA6B,EAC7B,UAAoB,EACpB,UAA8C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEpE,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAC5C,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,UAAU,EACV,OAAO,CACR,CAAC;IACF,OAAO,gCAAgC,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n AcknowledgeResult,\n ReleaseResult,\n RejectResult,\n RenewLocksResult,\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 PublishCloudEventOptionalParams,\n PublishCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n RejectCloudEventsOptionalParams,\n RenewCloudEventLocksOptionalParams,\n} from \"../models/options\";\n\nexport function _publishCloudEventSend(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptionalParams = { 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 a single Cloud Event to a namespace topic. */\nexport async function publishCloudEvent(\n context: Client,\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptionalParams = { 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: PublishCloudEventsOptionalParams = { 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 a batch of Cloud Events to a namespace topic. */\nexport async function publishCloudEvents(\n context: Client,\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptionalParams = { 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: ReceiveCloudEventsOptionalParams = { 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 details: 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 a batch of Cloud Events from a subscription. */\nexport async function receiveCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptionalParams = { 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 lockTokens: string[],\n options: AcknowledgeCloudEventsOptionalParams = { 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: 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 a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. */\nexport async function acknowledgeCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: AcknowledgeCloudEventsOptionalParams = { requestOptions: {} },\n): Promise<AcknowledgeResult> {\n const result = await _acknowledgeCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n return _acknowledgeCloudEventsDeserialize(result);\n}\n\nexport function _releaseCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: ReleaseCloudEventsOptionalParams = { requestOptions: {} },\n): StreamableMethod<ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse> {\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: options?.releaseDelayInSeconds,\n },\n body: { lockTokens: 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 a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. */\nexport async function releaseCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: ReleaseCloudEventsOptionalParams = { requestOptions: {} },\n): Promise<ReleaseResult> {\n const result = await _releaseCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n return _releaseCloudEventsDeserialize(result);\n}\n\nexport function _rejectCloudEventsSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RejectCloudEventsOptionalParams = { 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: 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 a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. */\nexport async function rejectCloudEvents(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RejectCloudEventsOptionalParams = { requestOptions: {} },\n): Promise<RejectResult> {\n const result = await _rejectCloudEventsSend(\n context,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n return _rejectCloudEventsDeserialize(result);\n}\n\nexport function _renewCloudEventLocksSend(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RenewCloudEventLocksOptionalParams = { 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: lockTokens },\n });\n}\n\nexport async function _renewCloudEventLocksDeserialize(\n result: RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse,\n): Promise<RenewLocksResult> {\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 locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. */\nexport async function renewCloudEventLocks(\n context: Client,\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RenewCloudEventLocksOptionalParams = { requestOptions: {} },\n): Promise<RenewLocksResult> {\n const result = await _renewCloudEventLocksSend(\n context,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n return _renewCloudEventLocksDeserialize(result);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export { EventGridClient } from "./EventGridClient";
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cadl-generated/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAA0B,MAAM,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { EventGridClient, EventGridClientOptions } from \"./EventGridClient\";\nexport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n ReceiveDetails,\n BrokerProperties,\n AcknowledgeResult,\n FailedLockToken,\n ReleaseDelay,\n ReleaseResult,\n RejectResult,\n RenewLocksResult,\n ServiceApiVersions,\n ErrorResponse,\n PublishCloudEventOptionalParams,\n PublishCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n RejectCloudEventsOptionalParams,\n RenewCloudEventLocksOptionalParams,\n} from \"./models/index\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cadl-generated/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAA0B,MAAM,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { EventGridClient, EventGridClientOptions } from \"./EventGridClient\";\nexport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n ReceiveDetails,\n BrokerProperties,\n AcknowledgeResult,\n FailedLockToken,\n ReleaseDelay,\n ReleaseResult,\n RejectResult,\n RenewLocksResult,\n ServiceApiVersions,\n ErrorResponse,\n PublishCloudEventOptionalParams,\n PublishCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n RejectCloudEventsOptionalParams,\n RenewCloudEventLocksOptionalParams,\n} from \"./models/index\";\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createClientLogger } from "@azure/logger";
4
4
  export const logger = createClientLogger("eventgrid-namespaces");
5
5
  //# sourceMappingURL=logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/cadl-generated/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"eventgrid-namespaces\");\n"]}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/cadl-generated/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"eventgrid-namespaces\");\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cadl-generated/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n ReceiveDetails,\n BrokerProperties,\n AcknowledgeResult,\n FailedLockToken,\n ReleaseDelay,\n ReleaseResult,\n RejectResult,\n RenewLocksResult,\n ServiceApiVersions,\n ErrorResponse,\n} from \"./models\";\nexport {\n PublishCloudEventOptionalParams,\n PublishCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n RejectCloudEventsOptionalParams,\n RenewCloudEventLocksOptionalParams,\n} from \"./options\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cadl-generated/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n ReceiveDetails,\n BrokerProperties,\n AcknowledgeResult,\n FailedLockToken,\n ReleaseDelay,\n ReleaseResult,\n RejectResult,\n RenewLocksResult,\n ServiceApiVersions,\n ErrorResponse,\n} from \"./models\";\nexport {\n PublishCloudEventOptionalParams,\n PublishCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n RejectCloudEventsOptionalParams,\n RenewCloudEventLocksOptionalParams,\n} from \"./options\";\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/cadl-generated/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ErrorModel } from \"@azure-rest/core-client\";\n\n/** Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema. */\nexport interface CloudEvent {\n /** An identifier for the event. The combination of id and source must be unique for each distinct event. */\n id: string;\n /** Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. */\n source: string;\n /** Event data specific to the event type. */\n data?: unknown;\n /** Event data specific to the event type, encoded as a base64 string. */\n dataBase64?: Uint8Array;\n /** Type of event related to the originating occurrence. */\n type: string;\n /** The time (in UTC) the event was generated, in RFC3339 format. */\n time?: Date;\n /** The version of the CloudEvents specification which the event uses. */\n specversion: string;\n /** Identifies the schema that data adheres to. */\n dataschema?: string;\n /** Content type of data value. */\n datacontenttype?: string;\n /** This describes the subject of the event in the context of the event producer (identified by source). */\n subject?: string;\n}\n\n/** The result of the Publish operation. */\nexport interface PublishResult {}\n\n/** Details of the Receive operation response. */\nexport interface ReceiveResult {\n /** Array of receive responses, one per cloud event. */\n details: ReceiveDetails[];\n}\n\n/** Receive operation details per Cloud Event. */\nexport interface ReceiveDetails {\n /** The Event Broker details. */\n brokerProperties: BrokerProperties;\n /** Cloud Event details. */\n event: CloudEvent;\n}\n\n/** Properties of the Event Broker operation. */\nexport interface BrokerProperties {\n /** The token of the lock on the event. */\n lockToken: string;\n /** The attempt count for delivering the event. */\n deliveryCount: number;\n}\n\n/** The result of the Acknowledge operation. */\nexport interface AcknowledgeResult {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: FailedLockToken[];\n /** Array of lock tokens for the successfully acknowledged cloud events. */\n succeededLockTokens: string[];\n}\n\n/** Failed LockToken information. */\nexport interface FailedLockToken {\n /** The lock token of an entry in the request. */\n lockToken: string;\n /** Error information of the failed operation result for the lock token in the request. */\n error: ErrorModel;\n}\n\n/** Supported delays for release operation. */\n/** \"0\", \"10\", \"60\", \"600\", \"3600\" */\nexport type ReleaseDelay = string;\n\n/** The result of the Release operation. */\nexport interface ReleaseResult {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: FailedLockToken[];\n /** Array of lock tokens for the successfully released cloud events. */\n succeededLockTokens: string[];\n}\n\n/** The result of the Reject operation. */\nexport interface RejectResult {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: FailedLockToken[];\n /** Array of lock tokens for the successfully rejected cloud events. */\n succeededLockTokens: string[];\n}\n\n/** The result of the RenewLock operation. */\nexport interface RenewLocksResult {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: FailedLockToken[];\n /** Array of lock tokens for the successfully renewed locks. */\n succeededLockTokens: string[];\n}\n\n/** */\nexport type ServiceApiVersions =\n | \"2023-06-01-preview\"\n | \"2023-10-01-preview\"\n | \"2023-11-01\"\n | \"2024-06-01\";\n\nexport interface ErrorResponse {\n /** The error object. */\n error: ErrorModel;\n}\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/cadl-generated/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ErrorModel } from \"@azure-rest/core-client\";\n\n/** Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema. */\nexport interface CloudEvent {\n /** An identifier for the event. The combination of id and source must be unique for each distinct event. */\n id: string;\n /** Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. */\n source: string;\n /** Event data specific to the event type. */\n data?: unknown;\n /** Event data specific to the event type, encoded as a base64 string. */\n dataBase64?: Uint8Array;\n /** Type of event related to the originating occurrence. */\n type: string;\n /** The time (in UTC) the event was generated, in RFC3339 format. */\n time?: Date;\n /** The version of the CloudEvents specification which the event uses. */\n specversion: string;\n /** Identifies the schema that data adheres to. */\n dataschema?: string;\n /** Content type of data value. */\n datacontenttype?: string;\n /** This describes the subject of the event in the context of the event producer (identified by source). */\n subject?: string;\n}\n\n/** The result of the Publish operation. */\nexport interface PublishResult {}\n\n/** Details of the Receive operation response. */\nexport interface ReceiveResult {\n /** Array of receive responses, one per cloud event. */\n details: ReceiveDetails[];\n}\n\n/** Receive operation details per Cloud Event. */\nexport interface ReceiveDetails {\n /** The Event Broker details. */\n brokerProperties: BrokerProperties;\n /** Cloud Event details. */\n event: CloudEvent;\n}\n\n/** Properties of the Event Broker operation. */\nexport interface BrokerProperties {\n /** The token of the lock on the event. */\n lockToken: string;\n /** The attempt count for delivering the event. */\n deliveryCount: number;\n}\n\n/** The result of the Acknowledge operation. */\nexport interface AcknowledgeResult {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: FailedLockToken[];\n /** Array of lock tokens for the successfully acknowledged cloud events. */\n succeededLockTokens: string[];\n}\n\n/** Failed LockToken information. */\nexport interface FailedLockToken {\n /** The lock token of an entry in the request. */\n lockToken: string;\n /** Error information of the failed operation result for the lock token in the request. */\n error: ErrorModel;\n}\n\n/** Supported delays for release operation. */\n/** \"0\", \"10\", \"60\", \"600\", \"3600\" */\nexport type ReleaseDelay = string;\n\n/** The result of the Release operation. */\nexport interface ReleaseResult {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: FailedLockToken[];\n /** Array of lock tokens for the successfully released cloud events. */\n succeededLockTokens: string[];\n}\n\n/** The result of the Reject operation. */\nexport interface RejectResult {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: FailedLockToken[];\n /** Array of lock tokens for the successfully rejected cloud events. */\n succeededLockTokens: string[];\n}\n\n/** The result of the RenewLock operation. */\nexport interface RenewLocksResult {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: FailedLockToken[];\n /** Array of lock tokens for the successfully renewed locks. */\n succeededLockTokens: string[];\n}\n\n/** */\nexport type ServiceApiVersions =\n | \"2023-06-01-preview\"\n | \"2023-10-01-preview\"\n | \"2023-11-01\"\n | \"2024-06-01\";\n\nexport interface ErrorResponse {\n /** The error object. */\n error: ErrorModel;\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/cadl-generated/models/options.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { ReleaseDelay } from \"./models\";\n\nexport interface PublishCloudEventOptionalParams extends OperationOptions {\n /** content type */\n contentType?: string;\n}\n\nexport interface PublishCloudEventsOptionalParams extends OperationOptions {\n /** content type */\n contentType?: string;\n}\n\nexport interface ReceiveCloudEventsOptionalParams extends OperationOptions {\n /** Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. */\n maxEvents?: number;\n /** Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. */\n maxWaitTime?: number;\n}\n\nexport interface AcknowledgeCloudEventsOptionalParams extends OperationOptions {}\n\nexport interface ReleaseCloudEventsOptionalParams extends OperationOptions {\n /** Release cloud events with the specified delay in seconds. */\n releaseDelayInSeconds?: ReleaseDelay;\n}\n\nexport interface RejectCloudEventsOptionalParams extends OperationOptions {}\n\nexport interface RenewCloudEventLocksOptionalParams extends OperationOptions {}\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/cadl-generated/models/options.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationOptions } from \"@azure-rest/core-client\";\nimport { ReleaseDelay } from \"./models\";\n\nexport interface PublishCloudEventOptionalParams extends OperationOptions {\n /** content type */\n contentType?: string;\n}\n\nexport interface PublishCloudEventsOptionalParams extends OperationOptions {\n /** content type */\n contentType?: string;\n}\n\nexport interface ReceiveCloudEventsOptionalParams extends OperationOptions {\n /** Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. */\n maxEvents?: number;\n /** Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. */\n maxWaitTime?: number;\n}\n\nexport interface AcknowledgeCloudEventsOptionalParams extends OperationOptions {}\n\nexport interface ReleaseCloudEventsOptionalParams extends OperationOptions {\n /** Release cloud events with the specified delay in seconds. */\n releaseDelayInSeconds?: ReleaseDelay;\n}\n\nexport interface RejectCloudEventsOptionalParams extends OperationOptions {}\n\nexport interface RenewCloudEventLocksOptionalParams extends OperationOptions {}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=clientDefinitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PublishCloudEventParameters,\n PublishCloudEventsParameters,\n ReceiveCloudEventsParameters,\n AcknowledgeCloudEventsParameters,\n ReleaseCloudEventsParameters,\n RejectCloudEventsParameters,\n RenewCloudEventLocksParameters,\n} from \"./parameters\";\nimport {\n PublishCloudEvent200Response,\n PublishCloudEventDefaultResponse,\n PublishCloudEvents200Response,\n PublishCloudEventsDefaultResponse,\n ReceiveCloudEvents200Response,\n ReceiveCloudEventsDefaultResponse,\n AcknowledgeCloudEvents200Response,\n AcknowledgeCloudEventsDefaultResponse,\n ReleaseCloudEvents200Response,\n ReleaseCloudEventsDefaultResponse,\n RejectCloudEvents200Response,\n RejectCloudEventsDefaultResponse,\n RenewCloudEventLocks200Response,\n RenewCloudEventLocksDefaultResponse,\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface PublishCloudEvent {\n /** Publish a single Cloud Event to a namespace topic. */\n post(\n options: PublishCloudEventParameters,\n ): StreamableMethod<PublishCloudEvent200Response | PublishCloudEventDefaultResponse>;\n /** Publish a batch of Cloud Events to a namespace topic. */\n post(\n options: PublishCloudEventsParameters,\n ): StreamableMethod<PublishCloudEvents200Response | PublishCloudEventsDefaultResponse>;\n}\n\nexport interface ReceiveCloudEvents {\n /** Receive a batch of Cloud Events from a subscription. */\n post(\n options?: ReceiveCloudEventsParameters,\n ): StreamableMethod<ReceiveCloudEvents200Response | ReceiveCloudEventsDefaultResponse>;\n}\n\nexport interface AcknowledgeCloudEvents {\n /** Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. */\n post(\n options?: AcknowledgeCloudEventsParameters,\n ): StreamableMethod<AcknowledgeCloudEvents200Response | AcknowledgeCloudEventsDefaultResponse>;\n}\n\nexport interface ReleaseCloudEvents {\n /** Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. */\n post(\n options?: ReleaseCloudEventsParameters,\n ): StreamableMethod<ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse>;\n}\n\nexport interface RejectCloudEvents {\n /** Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. */\n post(\n options?: RejectCloudEventsParameters,\n ): StreamableMethod<RejectCloudEvents200Response | RejectCloudEventsDefaultResponse>;\n}\n\nexport interface RenewCloudEventLocks {\n /** Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. */\n post(\n options?: RenewCloudEventLocksParameters,\n ): StreamableMethod<RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/topics/\\{topicName\\}:publish' has methods for the following verbs: post */\n (path: \"/topics/{topicName}:publish\", topicName: string): PublishCloudEvent;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:receive' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive\",\n topicName: string,\n eventSubscriptionName: string,\n ): ReceiveCloudEvents;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:acknowledge' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge\",\n topicName: string,\n eventSubscriptionName: string,\n ): AcknowledgeCloudEvents;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:release' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release\",\n topicName: string,\n eventSubscriptionName: string,\n ): ReleaseCloudEvents;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:reject' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject\",\n topicName: string,\n eventSubscriptionName: string,\n ): RejectCloudEvents;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:renewLock' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock\",\n topicName: string,\n eventSubscriptionName: string,\n ): RenewCloudEventLocks;\n}\n\nexport type EventGridContext = Client & {\n path: Routes;\n};\n"]}
1
+ {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PublishCloudEventParameters,\n PublishCloudEventsParameters,\n ReceiveCloudEventsParameters,\n AcknowledgeCloudEventsParameters,\n ReleaseCloudEventsParameters,\n RejectCloudEventsParameters,\n RenewCloudEventLocksParameters,\n} from \"./parameters\";\nimport {\n PublishCloudEvent200Response,\n PublishCloudEventDefaultResponse,\n PublishCloudEvents200Response,\n PublishCloudEventsDefaultResponse,\n ReceiveCloudEvents200Response,\n ReceiveCloudEventsDefaultResponse,\n AcknowledgeCloudEvents200Response,\n AcknowledgeCloudEventsDefaultResponse,\n ReleaseCloudEvents200Response,\n ReleaseCloudEventsDefaultResponse,\n RejectCloudEvents200Response,\n RejectCloudEventsDefaultResponse,\n RenewCloudEventLocks200Response,\n RenewCloudEventLocksDefaultResponse,\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface PublishCloudEvent {\n /** Publish a single Cloud Event to a namespace topic. */\n post(\n options: PublishCloudEventParameters,\n ): StreamableMethod<PublishCloudEvent200Response | PublishCloudEventDefaultResponse>;\n /** Publish a batch of Cloud Events to a namespace topic. */\n post(\n options: PublishCloudEventsParameters,\n ): StreamableMethod<PublishCloudEvents200Response | PublishCloudEventsDefaultResponse>;\n}\n\nexport interface ReceiveCloudEvents {\n /** Receive a batch of Cloud Events from a subscription. */\n post(\n options?: ReceiveCloudEventsParameters,\n ): StreamableMethod<ReceiveCloudEvents200Response | ReceiveCloudEventsDefaultResponse>;\n}\n\nexport interface AcknowledgeCloudEvents {\n /** Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer. */\n post(\n options?: AcknowledgeCloudEventsParameters,\n ): StreamableMethod<AcknowledgeCloudEvents200Response | AcknowledgeCloudEventsDefaultResponse>;\n}\n\nexport interface ReleaseCloudEvents {\n /** Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers. */\n post(\n options?: ReleaseCloudEventsParameters,\n ): StreamableMethod<ReleaseCloudEvents200Response | ReleaseCloudEventsDefaultResponse>;\n}\n\nexport interface RejectCloudEvents {\n /** Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer. */\n post(\n options?: RejectCloudEventsParameters,\n ): StreamableMethod<RejectCloudEvents200Response | RejectCloudEventsDefaultResponse>;\n}\n\nexport interface RenewCloudEventLocks {\n /** Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock. */\n post(\n options?: RenewCloudEventLocksParameters,\n ): StreamableMethod<RenewCloudEventLocks200Response | RenewCloudEventLocksDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/topics/\\{topicName\\}:publish' has methods for the following verbs: post */\n (path: \"/topics/{topicName}:publish\", topicName: string): PublishCloudEvent;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:receive' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive\",\n topicName: string,\n eventSubscriptionName: string,\n ): ReceiveCloudEvents;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:acknowledge' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:acknowledge\",\n topicName: string,\n eventSubscriptionName: string,\n ): AcknowledgeCloudEvents;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:release' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:release\",\n topicName: string,\n eventSubscriptionName: string,\n ): ReleaseCloudEvents;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:reject' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:reject\",\n topicName: string,\n eventSubscriptionName: string,\n ): RejectCloudEvents;\n /** Resource for '/topics/\\{topicName\\}/eventsubscriptions/\\{eventSubscriptionName\\}:renewLock' has methods for the following verbs: post */\n (\n path: \"/topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:renewLock\",\n topicName: string,\n eventSubscriptionName: string,\n ): RenewCloudEventLocks;\n}\n\nexport type EventGridContext = Client & {\n path: Routes;\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { getClient } from "@azure-rest/core-client";
4
4
  import { logger } from "../logger";
5
5
  import { isKeyCredential } from "@azure/core-auth";
@@ -1 +1 @@
1
- {"version":3,"file":"eventGridClient.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/eventGridClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAkC,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4C,EAC5C,UAAyB,EAAE;;IAE3B,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,GAAG,aAAa,EAAE,CAAC;IAC9E,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,YAAY,CAAC;IACxD,MAAM,aAAa,GAAG,0CAA0C,CAAC;IACjE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,sCAAsC,CAAC;YAC/E,gBAAgB,EAAE,eAAe;SAClC,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAqB,CAAC;IAEhF,IAAI,eAAe,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YACxB,IAAI,EAAE,2BAA2B;YACjC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI;gBAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,kBAAkB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;gBAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// 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 endpointParam - 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 endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n options: ClientOptions = {},\n): EventGridContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;\n options.apiVersion = options.apiVersion ?? \"2024-06-01\";\n const userAgentInfo = `azsdk-js-eventgrid-namespaces-rest/1.0.0`;\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(endpointUrl, 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"]}
1
+ {"version":3,"file":"eventGridClient.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/eventGridClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAkC,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4C,EAC5C,UAAyB,EAAE;;IAE3B,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,GAAG,aAAa,EAAE,CAAC;IAC9E,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,YAAY,CAAC;IACxD,MAAM,aAAa,GAAG,0CAA0C,CAAC;IACjE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,sCAAsC,CAAC;YAC/E,gBAAgB,EAAE,eAAe;SAClC,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAqB,CAAC;IAEhF,IAAI,eAAe,CAAC,WAAW,CAAC,EAAE,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YACxB,IAAI,EAAE,2BAA2B;YACjC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI;gBAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,kBAAkB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;gBAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// 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 endpointParam - 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 endpointParam: string,\n credentials: TokenCredential | KeyCredential,\n options: ClientOptions = {},\n): EventGridContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;\n options.apiVersion = options.apiVersion ?? \"2024-06-01\";\n const userAgentInfo = `azsdk-js-eventgrid-namespaces-rest/1.0.0`;\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(endpointUrl, 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"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import EventGridClient from "./eventGridClient";
4
4
  export * from "./eventGridClient";
5
5
  export * from "./parameters";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAE/B,eAAe,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport EventGridClient from \"./eventGridClient\";\n\nexport * from \"./eventGridClient\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\n\nexport default EventGridClient;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAE/B,eAAe,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport EventGridClient from \"./eventGridClient\";\n\nexport * from \"./eventGridClient\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\n\nexport default EventGridClient;\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  const responseMap = {
4
4
  "POST /topics/{topicName}:publish": ["200"],
5
5
  "POST /topics/{topicName}/eventsubscriptions/{eventSubscriptionName}:receive": ["200"],
@@ -1 +1 @@
1
- {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmBlC,MAAM,WAAW,GAA6B;IAC5C,kCAAkC,EAAE,CAAC,KAAK,CAAC;IAC3C,6EAA6E,EAAE,CAAC,KAAK,CAAC;IACtF,iFAAiF,EAAE,CAAC,KAAK,CAAC;IAC1F,6EAA6E,EAAE,CAAC,KAAK,CAAC;IACtF,4EAA4E,EAAE,CAAC,KAAK,CAAC;IACrF,+EAA+E,EAAE,CAAC,KAAK,CAAC;CACzF,CAAC;AAuBF,MAAM,UAAU,YAAY,CAC1B,QAcuC;IASvC,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GA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,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PublishCloudEvent200Response,\n PublishCloudEventDefaultResponse,\n PublishCloudEvents200Response,\n PublishCloudEventsDefaultResponse,\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: PublishCloudEvent200Response | PublishCloudEventDefaultResponse,\n): response is PublishCloudEventDefaultResponse;\nexport function isUnexpected(\n response: PublishCloudEvents200Response | PublishCloudEventsDefaultResponse,\n): response is PublishCloudEventsDefaultResponse;\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 | PublishCloudEventDefaultResponse\n | PublishCloudEvents200Response\n | PublishCloudEventsDefaultResponse\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 | PublishCloudEventsDefaultResponse\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"]}
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmBlC,MAAM,WAAW,GAA6B;IAC5C,kCAAkC,EAAE,CAAC,KAAK,CAAC;IAC3C,6EAA6E,EAAE,CAAC,KAAK,CAAC;IACtF,iFAAiF,EAAE,CAAC,KAAK,CAAC;IAC1F,6EAA6E,EAAE,CAAC,KAAK,CAAC;IACtF,4EAA4E,EAAE,CAAC,KAAK,CAAC;IACrF,+EAA+E,EAAE,CAAC,KAAK,CAAC;CACzF,CAAC;AAuBF,MAAM,UAAU,YAAY,CAC1B,QAcuC;IASvC,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,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C;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PublishCloudEvent200Response,\n PublishCloudEventDefaultResponse,\n PublishCloudEvents200Response,\n PublishCloudEventsDefaultResponse,\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: PublishCloudEvent200Response | PublishCloudEventDefaultResponse,\n): response is PublishCloudEventDefaultResponse;\nexport function isUnexpected(\n response: PublishCloudEvents200Response | PublishCloudEventsDefaultResponse,\n): response is PublishCloudEventsDefaultResponse;\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 | PublishCloudEventDefaultResponse\n | PublishCloudEvents200Response\n | PublishCloudEventsDefaultResponse\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 | PublishCloudEventsDefaultResponse\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"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/** Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema. */\nexport interface CloudEvent {\n /** An identifier for the event. The combination of id and source must be unique for each distinct event. */\n id: string;\n /** Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. */\n source: string;\n /** Event data specific to the event type. */\n data?: unknown;\n /** Event data specific to the event type, encoded as a base64 string. */\n data_base64?: string;\n /** Type of event related to the originating occurrence. */\n type: string;\n /** The time (in UTC) the event was generated, in RFC3339 format. */\n time?: Date | string;\n /** The version of the CloudEvents specification which the event uses. */\n specversion: string;\n /** Identifies the schema that data adheres to. */\n dataschema?: string;\n /** Content type of data value. */\n datacontenttype?: string;\n /** This describes the subject of the event in the context of the event producer (identified by source). */\n subject?: string;\n}\n\n/** Alias for ReleaseDelay */\nexport type ReleaseDelay = string | \"0\" | \"10\" | \"60\" | \"600\" | \"3600\";\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema. */\nexport interface CloudEvent {\n /** An identifier for the event. The combination of id and source must be unique for each distinct event. */\n id: string;\n /** Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. */\n source: string;\n /** Event data specific to the event type. */\n data?: unknown;\n /** Event data specific to the event type, encoded as a base64 string. */\n data_base64?: string;\n /** Type of event related to the originating occurrence. */\n type: string;\n /** The time (in UTC) the event was generated, in RFC3339 format. */\n time?: Date | string;\n /** The version of the CloudEvents specification which the event uses. */\n specversion: string;\n /** Identifies the schema that data adheres to. */\n dataschema?: string;\n /** Content type of data value. */\n datacontenttype?: string;\n /** This describes the subject of the event in the context of the event producer (identified by source). */\n subject?: string;\n}\n\n/** Alias for ReleaseDelay */\nexport type ReleaseDelay = string | \"0\" | \"10\" | \"60\" | \"600\" | \"3600\";\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=outputModels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ErrorModel } from \"@azure-rest/core-client\";\n\n/** Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema. */\nexport interface CloudEventOutput {\n /** An identifier for the event. The combination of id and source must be unique for each distinct event. */\n id: string;\n /** Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. */\n source: string;\n /** Event data specific to the event type. */\n data?: any;\n /** Event data specific to the event type, encoded as a base64 string. */\n data_base64?: string;\n /** Type of event related to the originating occurrence. */\n type: string;\n /** The time (in UTC) the event was generated, in RFC3339 format. */\n time?: string;\n /** The version of the CloudEvents specification which the event uses. */\n specversion: string;\n /** Identifies the schema that data adheres to. */\n dataschema?: string;\n /** Content type of data value. */\n datacontenttype?: string;\n /** This describes the subject of the event in the context of the event producer (identified by source). */\n subject?: string;\n}\n\n/** The result of the Publish operation. */\nexport interface PublishResultOutput {}\n\n/** Details of the Receive operation response. */\nexport interface ReceiveResultOutput {\n /** Array of receive responses, one per cloud event. */\n value: Array<ReceiveDetailsOutput>;\n}\n\n/** Receive operation details per Cloud Event. */\nexport interface ReceiveDetailsOutput {\n /** The Event Broker details. */\n brokerProperties: BrokerPropertiesOutput;\n /** Cloud Event details. */\n event: CloudEventOutput;\n}\n\n/** Properties of the Event Broker operation. */\nexport interface BrokerPropertiesOutput {\n /** The token of the lock on the event. */\n lockToken: string;\n /** The attempt count for delivering the event. */\n deliveryCount: number;\n}\n\n/** The result of the Acknowledge operation. */\nexport interface AcknowledgeResultOutput {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: Array<FailedLockTokenOutput>;\n /** Array of lock tokens for the successfully acknowledged cloud events. */\n succeededLockTokens: string[];\n}\n\n/** Failed LockToken information. */\nexport interface FailedLockTokenOutput {\n /** The lock token of an entry in the request. */\n lockToken: string;\n /** Error information of the failed operation result for the lock token in the request. */\n error: ErrorModel;\n}\n\n/** The result of the Release operation. */\nexport interface ReleaseResultOutput {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: Array<FailedLockTokenOutput>;\n /** Array of lock tokens for the successfully released cloud events. */\n succeededLockTokens: string[];\n}\n\n/** The result of the Reject operation. */\nexport interface RejectResultOutput {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: Array<FailedLockTokenOutput>;\n /** Array of lock tokens for the successfully rejected cloud events. */\n succeededLockTokens: string[];\n}\n\n/** The result of the RenewLock operation. */\nexport interface RenewCloudEventLocksResultOutput {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: Array<FailedLockTokenOutput>;\n /** Array of lock tokens for the successfully renewed locks. */\n succeededLockTokens: string[];\n}\n"]}
1
+ {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ErrorModel } from \"@azure-rest/core-client\";\n\n/** Properties of an event published to an Azure Messaging EventGrid Namespace topic using the CloudEvent 1.0 Schema. */\nexport interface CloudEventOutput {\n /** An identifier for the event. The combination of id and source must be unique for each distinct event. */\n id: string;\n /** Identifies the context in which an event happened. The combination of id and source must be unique for each distinct event. */\n source: string;\n /** Event data specific to the event type. */\n data?: any;\n /** Event data specific to the event type, encoded as a base64 string. */\n data_base64?: string;\n /** Type of event related to the originating occurrence. */\n type: string;\n /** The time (in UTC) the event was generated, in RFC3339 format. */\n time?: string;\n /** The version of the CloudEvents specification which the event uses. */\n specversion: string;\n /** Identifies the schema that data adheres to. */\n dataschema?: string;\n /** Content type of data value. */\n datacontenttype?: string;\n /** This describes the subject of the event in the context of the event producer (identified by source). */\n subject?: string;\n}\n\n/** The result of the Publish operation. */\nexport interface PublishResultOutput {}\n\n/** Details of the Receive operation response. */\nexport interface ReceiveResultOutput {\n /** Array of receive responses, one per cloud event. */\n value: Array<ReceiveDetailsOutput>;\n}\n\n/** Receive operation details per Cloud Event. */\nexport interface ReceiveDetailsOutput {\n /** The Event Broker details. */\n brokerProperties: BrokerPropertiesOutput;\n /** Cloud Event details. */\n event: CloudEventOutput;\n}\n\n/** Properties of the Event Broker operation. */\nexport interface BrokerPropertiesOutput {\n /** The token of the lock on the event. */\n lockToken: string;\n /** The attempt count for delivering the event. */\n deliveryCount: number;\n}\n\n/** The result of the Acknowledge operation. */\nexport interface AcknowledgeResultOutput {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: Array<FailedLockTokenOutput>;\n /** Array of lock tokens for the successfully acknowledged cloud events. */\n succeededLockTokens: string[];\n}\n\n/** Failed LockToken information. */\nexport interface FailedLockTokenOutput {\n /** The lock token of an entry in the request. */\n lockToken: string;\n /** Error information of the failed operation result for the lock token in the request. */\n error: ErrorModel;\n}\n\n/** The result of the Release operation. */\nexport interface ReleaseResultOutput {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: Array<FailedLockTokenOutput>;\n /** Array of lock tokens for the successfully released cloud events. */\n succeededLockTokens: string[];\n}\n\n/** The result of the Reject operation. */\nexport interface RejectResultOutput {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: Array<FailedLockTokenOutput>;\n /** Array of lock tokens for the successfully rejected cloud events. */\n succeededLockTokens: string[];\n}\n\n/** The result of the RenewLock operation. */\nexport interface RenewCloudEventLocksResultOutput {\n /** Array of FailedLockToken for failed cloud events. Each FailedLockToken includes the lock token along with the related error information (namely, the error code and description). */\n failedLockTokens: Array<FailedLockTokenOutput>;\n /** Array of lock tokens for the successfully renewed locks. */\n succeededLockTokens: string[];\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=parameters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport { CloudEvent, ReleaseDelay } from \"./models\";\n\nexport interface PublishCloudEventBodyParam {\n /** Single Cloud Event being published. */\n body: CloudEvent;\n}\n\nexport interface PublishCloudEventMediaTypesParam {\n /** content type */\n contentType: \"application/cloudevents+json; charset=utf-8\";\n}\n\nexport type PublishCloudEventParameters = PublishCloudEventMediaTypesParam &\n PublishCloudEventBodyParam &\n RequestParameters;\n\nexport interface PublishCloudEventsBodyParam {\n /** Array of Cloud Events being published. */\n body: Array<CloudEvent>;\n}\n\nexport interface PublishCloudEventsMediaTypesParam {\n /** content type */\n contentType: \"application/cloudevents-batch+json; charset=utf-8\";\n}\n\nexport type PublishCloudEventsParameters = PublishCloudEventsMediaTypesParam &\n PublishCloudEventsBodyParam &\n RequestParameters;\n\nexport interface ReceiveCloudEventsQueryParamProperties {\n /** Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. */\n maxEvents?: number;\n /** Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. */\n maxWaitTime?: number;\n}\n\nexport interface ReceiveCloudEventsQueryParam {\n queryParameters?: ReceiveCloudEventsQueryParamProperties;\n}\n\nexport type ReceiveCloudEventsParameters = ReceiveCloudEventsQueryParam & RequestParameters;\n\nexport interface AcknowledgeCloudEventsBodyParam {\n body?: { lockTokens: string[] };\n}\n\nexport type AcknowledgeCloudEventsParameters = AcknowledgeCloudEventsBodyParam & RequestParameters;\n\nexport interface ReleaseCloudEventsBodyParam {\n body?: { lockTokens: string[] };\n}\n\nexport interface ReleaseCloudEventsQueryParamProperties {\n /** Release cloud events with the specified delay in seconds. */\n releaseDelayInSeconds?: ReleaseDelay;\n}\n\nexport interface ReleaseCloudEventsQueryParam {\n queryParameters?: ReleaseCloudEventsQueryParamProperties;\n}\n\nexport type ReleaseCloudEventsParameters = ReleaseCloudEventsQueryParam &\n ReleaseCloudEventsBodyParam &\n RequestParameters;\n\nexport interface RejectCloudEventsBodyParam {\n body?: { lockTokens: string[] };\n}\n\nexport type RejectCloudEventsParameters = RejectCloudEventsBodyParam & RequestParameters;\n\nexport interface RenewCloudEventLocksBodyParam {\n body?: { lockTokens: string[] };\n}\n\nexport type RenewCloudEventLocksParameters = RenewCloudEventLocksBodyParam & RequestParameters;\n"]}
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport { CloudEvent, ReleaseDelay } from \"./models\";\n\nexport interface PublishCloudEventBodyParam {\n /** Single Cloud Event being published. */\n body: CloudEvent;\n}\n\nexport interface PublishCloudEventMediaTypesParam {\n /** content type */\n contentType: \"application/cloudevents+json; charset=utf-8\";\n}\n\nexport type PublishCloudEventParameters = PublishCloudEventMediaTypesParam &\n PublishCloudEventBodyParam &\n RequestParameters;\n\nexport interface PublishCloudEventsBodyParam {\n /** Array of Cloud Events being published. */\n body: Array<CloudEvent>;\n}\n\nexport interface PublishCloudEventsMediaTypesParam {\n /** content type */\n contentType: \"application/cloudevents-batch+json; charset=utf-8\";\n}\n\nexport type PublishCloudEventsParameters = PublishCloudEventsMediaTypesParam &\n PublishCloudEventsBodyParam &\n RequestParameters;\n\nexport interface ReceiveCloudEventsQueryParamProperties {\n /** Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1. */\n maxEvents?: number;\n /** Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. */\n maxWaitTime?: number;\n}\n\nexport interface ReceiveCloudEventsQueryParam {\n queryParameters?: ReceiveCloudEventsQueryParamProperties;\n}\n\nexport type ReceiveCloudEventsParameters = ReceiveCloudEventsQueryParam & RequestParameters;\n\nexport interface AcknowledgeCloudEventsBodyParam {\n body?: { lockTokens: string[] };\n}\n\nexport type AcknowledgeCloudEventsParameters = AcknowledgeCloudEventsBodyParam & RequestParameters;\n\nexport interface ReleaseCloudEventsBodyParam {\n body?: { lockTokens: string[] };\n}\n\nexport interface ReleaseCloudEventsQueryParamProperties {\n /** Release cloud events with the specified delay in seconds. */\n releaseDelayInSeconds?: ReleaseDelay;\n}\n\nexport interface ReleaseCloudEventsQueryParam {\n queryParameters?: ReleaseCloudEventsQueryParamProperties;\n}\n\nexport type ReleaseCloudEventsParameters = ReleaseCloudEventsQueryParam &\n ReleaseCloudEventsBodyParam &\n RequestParameters;\n\nexport interface RejectCloudEventsBodyParam {\n body?: { lockTokens: string[] };\n}\n\nexport type RejectCloudEventsParameters = RejectCloudEventsBodyParam & RequestParameters;\n\nexport interface RenewCloudEventLocksBodyParam {\n body?: { lockTokens: string[] };\n}\n\nexport type RenewCloudEventLocksParameters = RenewCloudEventLocksBodyParam & RequestParameters;\n"]}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export {};
4
4
  //# sourceMappingURL=responses.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { HttpResponse, ErrorResponse } from \"@azure-rest/core-client\";\nimport {\n PublishResultOutput,\n ReceiveResultOutput,\n AcknowledgeResultOutput,\n ReleaseResultOutput,\n RejectResultOutput,\n RenewCloudEventLocksResultOutput,\n} from \"./outputModels\";\n\n/** The request has succeeded. */\nexport interface PublishCloudEvent200Response extends HttpResponse {\n status: \"200\";\n body: PublishResultOutput;\n}\n\nexport interface PublishCloudEventDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface PublishCloudEventDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & PublishCloudEventDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface PublishCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: PublishResultOutput;\n}\n\nexport interface PublishCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface PublishCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & PublishCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ReceiveCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: ReceiveResultOutput;\n}\n\nexport interface ReceiveCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ReceiveCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ReceiveCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface AcknowledgeCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: AcknowledgeResultOutput;\n}\n\nexport interface AcknowledgeCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface AcknowledgeCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & AcknowledgeCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ReleaseCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: ReleaseResultOutput;\n}\n\nexport interface ReleaseCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ReleaseCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ReleaseCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface RejectCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: RejectResultOutput;\n}\n\nexport interface RejectCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface RejectCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & RejectCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface RenewCloudEventLocks200Response extends HttpResponse {\n status: \"200\";\n body: RenewCloudEventLocksResultOutput;\n}\n\nexport interface RenewCloudEventLocksDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface RenewCloudEventLocksDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & RenewCloudEventLocksDefaultHeaders;\n}\n"]}
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../../src/cadl-generated/rest/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { HttpResponse, ErrorResponse } from \"@azure-rest/core-client\";\nimport {\n PublishResultOutput,\n ReceiveResultOutput,\n AcknowledgeResultOutput,\n ReleaseResultOutput,\n RejectResultOutput,\n RenewCloudEventLocksResultOutput,\n} from \"./outputModels\";\n\n/** The request has succeeded. */\nexport interface PublishCloudEvent200Response extends HttpResponse {\n status: \"200\";\n body: PublishResultOutput;\n}\n\nexport interface PublishCloudEventDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface PublishCloudEventDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & PublishCloudEventDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface PublishCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: PublishResultOutput;\n}\n\nexport interface PublishCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface PublishCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & PublishCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ReceiveCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: ReceiveResultOutput;\n}\n\nexport interface ReceiveCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ReceiveCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ReceiveCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface AcknowledgeCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: AcknowledgeResultOutput;\n}\n\nexport interface AcknowledgeCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface AcknowledgeCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & AcknowledgeCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface ReleaseCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: ReleaseResultOutput;\n}\n\nexport interface ReleaseCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ReleaseCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ReleaseCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface RejectCloudEvents200Response extends HttpResponse {\n status: \"200\";\n body: RejectResultOutput;\n}\n\nexport interface RejectCloudEventsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface RejectCloudEventsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & RejectCloudEventsDefaultHeaders;\n}\n\n/** The request has succeeded. */\nexport interface RenewCloudEventLocks200Response extends HttpResponse {\n status: \"200\";\n body: RenewCloudEventLocksResultOutput;\n}\n\nexport interface RenewCloudEventLocksDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface RenewCloudEventLocksDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & RenewCloudEventLocksDefaultHeaders;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  export const CloudEventBatchContentType = "application/cloudevents-batch+json; charset=utf-8";
4
4
  export const TraceParentHeaderName = "traceparent";
5
5
  export const TraceStateHeaderName = "tracestate";
@@ -1 +1 @@
1
- {"version":3,"file":"cloudEventDistrubtedTracingEnricherPolicy.js","sourceRoot":"","sources":["../../src/cloudEventDistrubtedTracingEnricherPolicy.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AC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YAC5C,CAAC;YAED,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelineResponse,\n PipelineRequest,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\n\nexport const CloudEventBatchContentType = \"application/cloudevents-batch+json; charset=utf-8\";\nexport const TraceParentHeaderName = \"traceparent\";\nexport const TraceStateHeaderName = \"tracestate\";\nexport const ContentTypeHeaderName = \"Content-Type\";\n\n/**\n * The programmatic identifier of the cloudEventDistributedTracingEnricherPolicy.\n */\nexport const cloudEventDistributedTracingEnricherPolicyName =\n \"cloudEventDistributedTracingEnricherPolicy\";\n\n/**\n * cloudEventDistributedTracingEnricherPolicy is a policy which adds distributed tracing information\n * to a batch of cloud events. It does so by copying the `traceparent` and `tracestate` properties\n * from the HTTP request into the individual events as extension properties.\n *\n * This will only happen in the case where an event does not have a `traceparent` defined already. This\n * allows events to explicitly set a traceparent and tracestate which would be respected during \"multi-hop\n * transmition\".\n *\n * See https://github.com/cloudevents/spec/blob/master/extensions/distributed-tracing.md\n * for more information on distributed tracing and cloud events.\n */\nexport function cloudEventDistributedTracingEnricherPolicy(): PipelinePolicy {\n return {\n name: cloudEventDistributedTracingEnricherPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const traceparent = request.headers.get(TraceParentHeaderName);\n const tracestate = request.headers.get(TraceStateHeaderName);\n\n if (\n request.headers.get(ContentTypeHeaderName) === CloudEventBatchContentType &&\n typeof request.body === \"string\" &&\n traceparent\n ) {\n // per the cloud event batched content type we know the body is an array encoded in JSON.\n const parsedBody = JSON.parse(request.body) as any[];\n\n for (const item of parsedBody) {\n // When using the distributed tracing extension, the \"traceparent\" is a required property\n // and \"tracestate\" is optional. This means if an item already has a \"traceparent\" property\n // we should not stomp over it. Well formed events will not have a \"tracestate\" without\n // also having a \"traceparent\" so there's no need to guard against that case.\n if (typeof item !== \"object\" || item.traceparent) {\n continue;\n }\n\n item.traceparent = traceparent;\n if (tracestate) {\n item.tracestate = tracestate;\n }\n }\n\n request.body = JSON.stringify(parsedBody);\n }\n\n return next(request);\n },\n };\n}\n"]}
1
+ {"version":3,"file":"cloudEventDistrubtedTracingEnricherPolicy.js","sourceRoot":"","sources":["../../src/cloudEventDistrubtedTracingEnricherPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,MAAM,CAAC,MAAM,0BAA0B,GAAG,mDAAmD,CAAC;AAC9F,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;AACnD,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,8CAA8C,GACzD,4CAA4C,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,0CAA0C;IACxD,OAAO;QACL,IAAI,EAAE,8CAA8C;QACpD,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;YAC/D,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAE7D,IACE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,0BAA0B;gBACzE,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ;gBAChC,WAAW,EACX,CAAC;gBACD,yFAAyF;gBACzF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAU,CAAC;gBAErD,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;oBAC9B,yFAAyF;oBACzF,2FAA2F;oBAC3F,uFAAuF;oBACvF,6EAA6E;oBAC7E,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;wBACjD,SAAS;oBACX,CAAC;oBAED,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;oBAC/B,IAAI,UAAU,EAAE,CAAC;wBACf,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;oBAC/B,CAAC;gBACH,CAAC;gBAED,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YAC5C,CAAC;YAED,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PipelineResponse,\n PipelineRequest,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\n\nexport const CloudEventBatchContentType = \"application/cloudevents-batch+json; charset=utf-8\";\nexport const TraceParentHeaderName = \"traceparent\";\nexport const TraceStateHeaderName = \"tracestate\";\nexport const ContentTypeHeaderName = \"Content-Type\";\n\n/**\n * The programmatic identifier of the cloudEventDistributedTracingEnricherPolicy.\n */\nexport const cloudEventDistributedTracingEnricherPolicyName =\n \"cloudEventDistributedTracingEnricherPolicy\";\n\n/**\n * cloudEventDistributedTracingEnricherPolicy is a policy which adds distributed tracing information\n * to a batch of cloud events. It does so by copying the `traceparent` and `tracestate` properties\n * from the HTTP request into the individual events as extension properties.\n *\n * This will only happen in the case where an event does not have a `traceparent` defined already. This\n * allows events to explicitly set a traceparent and tracestate which would be respected during \"multi-hop\n * transmition\".\n *\n * See https://github.com/cloudevents/spec/blob/master/extensions/distributed-tracing.md\n * for more information on distributed tracing and cloud events.\n */\nexport function cloudEventDistributedTracingEnricherPolicy(): PipelinePolicy {\n return {\n name: cloudEventDistributedTracingEnricherPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const traceparent = request.headers.get(TraceParentHeaderName);\n const tracestate = request.headers.get(TraceStateHeaderName);\n\n if (\n request.headers.get(ContentTypeHeaderName) === CloudEventBatchContentType &&\n typeof request.body === \"string\" &&\n traceparent\n ) {\n // per the cloud event batched content type we know the body is an array encoded in JSON.\n const parsedBody = JSON.parse(request.body) as any[];\n\n for (const item of parsedBody) {\n // When using the distributed tracing extension, the \"traceparent\" is a required property\n // and \"tracestate\" is optional. This means if an item already has a \"traceparent\" property\n // we should not stomp over it. Well formed events will not have a \"tracestate\" without\n // also having a \"traceparent\" so there's no need to guard against that case.\n if (typeof item !== \"object\" || item.traceparent) {\n continue;\n }\n\n item.traceparent = traceparent;\n if (tracestate) {\n item.tracestate = tracestate;\n }\n }\n\n request.body = JSON.stringify(parsedBody);\n }\n\n return next(request);\n },\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { createSerializer } from "@azure/core-client";
4
4
  import { cloudEventReservedPropertyNames } from "./models";
5
5
  import { CloudEvent as CloudEventMapper, parseAndWrap, validateCloudEventEvent } from "./util";
@@ -1 +1 @@
1
- {"version":3,"file":"consumer.js","sourceRoot":"","sources":["../../src/consumer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAc,+BAA+B,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAE/F,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,OAAO,qBAAqB;IAiBzB,KAAK,CAAC,sBAAsB,CACjC,aAA+C;QAE/C,MAAM,YAAY,GAAG,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,kDAAkD,CAAC,CAAC;gBAC1E,CAAC;gBAED,IAAI,CAAC,CAAC,YAAY,CAAC,UAAU,YAAY,UAAU,CAAC,EAAE,CAAC;oBACrD,MAAM,IAAI,SAAS,CAAC,6DAA6D,CAAC,CAAC;gBACrF,CAAC;gBAED,UAAU,CAAC,IAAI,GAAG,YAAY,CAAC,UAAU,CAAC;YAC5C,CAAC;YAED,4FAA4F;YAC5F,MAAM,mBAAmB,qBAAQ,YAAY,CAAE,CAAC;YAChD,KAAK,MAAM,QAAQ,IAAI,+BAA+B,EAAE,CAAC;gBACvD,OAAO,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YACvC,CAAC;YACD,OAAO,mBAAmB,CAAC,UAAU,CAAC;YAEtC,oDAAoD;YACpD,IAAI,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAChD,UAAU,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;YACvD,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,UAAiC,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createSerializer } from \"@azure/core-client\";\nimport { CloudEvent, cloudEventReservedPropertyNames } from \"./models\";\nimport { CloudEvent as CloudEventMapper, parseAndWrap, validateCloudEventEvent } from \"./util\";\n\nconst serializer = createSerializer();\n\n/**\n * EventGridDeserializer is used to aid in processing events delivered by EventGrid. It can deserialize a JSON encoded payload\n * of either a single event or batch of events as well as be used to convert the result of `JSON.parse` into an\n * `EventGridEvent` or `CloudEvent` like object.\n *\n * Unlike normal JSON deseralization, EventGridDeserializer does some additional conversions:\n *\n * - The consumer parses the event time property into a `Date` object, for ease of use.\n * - When deserializing an event in the CloudEvent schema, if the event contains binary data, it is base64 decoded\n * and returned as an instance of the `Uint8Array` type.\n */\nexport class EventGridDeserializer {\n /**\n * Deserializes events encoded in the Cloud Events 1.0 schema.\n *\n * @param encodedEvents - the JSON encoded representation of either a single event or an array of\n * events, encoded in the Cloud Events 1.0 Schema.\n */\n public async deserializeCloudEvents(encodedEvents: string): Promise<CloudEvent<unknown>[]>;\n\n /**\n * Deserializes events encoded in the Cloud Events 1.0 schema.\n *\n * @param encodedEvents - an object representing a single event, encoded in the Cloud Events 1.0 schema.\n */\n public async deserializeCloudEvents(\n encodedEvents: Record<string, unknown>,\n ): Promise<CloudEvent<unknown>[]>;\n public async deserializeCloudEvents(\n encodedEvents: string | Record<string, unknown>,\n ): Promise<CloudEvent<unknown>[]> {\n const decodedArray = parseAndWrap(encodedEvents);\n\n const events: CloudEvent<unknown>[] = [];\n\n for (const o of decodedArray) {\n validateCloudEventEvent(o);\n\n // Check that the required fields are present and of the correct type and the optional fields are missing\n // or of the correct type.\n\n const deserialized = serializer.deserialize(CloudEventMapper, o, \"\");\n const modelEvent: Record<string, any> = {\n specversion: deserialized.specversion,\n id: deserialized.id,\n source: deserialized.source,\n type: deserialized.type,\n };\n\n if (deserialized.datacontenttype !== undefined) {\n modelEvent.datacontenttype = deserialized.datacontenttype;\n }\n\n if (deserialized.dataschema !== undefined) {\n modelEvent.dataschema = deserialized.dataschema;\n }\n\n if (deserialized.subject !== undefined) {\n modelEvent.subject = deserialized.subject;\n }\n\n if (deserialized.time !== undefined) {\n modelEvent.time = deserialized.time;\n }\n\n if (deserialized.data !== undefined) {\n modelEvent.data = deserialized.data;\n }\n\n // If the data the event represents binary, it is encoded as base64 text in a different property on the event and we need to transform it.\n if (deserialized.dataBase64 !== undefined) {\n if (deserialized.data !== undefined) {\n throw new TypeError(\"event contains both a data and data_base64 field\");\n }\n\n if (!(deserialized.dataBase64 instanceof Uint8Array)) {\n throw new TypeError(\"event data_base64 property is not an instance of Uint8Array\");\n }\n\n modelEvent.data = deserialized.dataBase64;\n }\n\n // Build the \"extensionsAttributes\" property bag by removing all known top level properties.\n const extensionAttributes = { ...deserialized };\n for (const propName of cloudEventReservedPropertyNames) {\n delete extensionAttributes[propName];\n }\n delete extensionAttributes.dataBase64;\n\n // If any properties remain, copy them to the model.\n if (Object.keys(extensionAttributes).length > 0) {\n modelEvent.extensionAttributes = extensionAttributes;\n }\n\n events.push(modelEvent as CloudEvent<unknown>);\n }\n\n return events;\n }\n}\n"]}
1
+ {"version":3,"file":"consumer.js","sourceRoot":"","sources":["../../src/consumer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAc,+BAA+B,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAE/F,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,OAAO,qBAAqB;IAiBzB,KAAK,CAAC,sBAAsB,CACjC,aAA+C;QAE/C,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;QAEjD,MAAM,MAAM,GAA0B,EAAE,CAAC;QAEzC,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;YAC7B,uBAAuB,CAAC,CAAC,CAAC,CAAC;YAE3B,yGAAyG;YACzG,0BAA0B;YAE1B,MAAM,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YACrE,MAAM,UAAU,GAAwB;gBACtC,WAAW,EAAE,YAAY,CAAC,WAAW;gBACrC,EAAE,EAAE,YAAY,CAAC,EAAE;gBACnB,MAAM,EAAE,YAAY,CAAC,MAAM;gBAC3B,IAAI,EAAE,YAAY,CAAC,IAAI;aACxB,CAAC;YAEF,IAAI,YAAY,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;gBAC/C,UAAU,CAAC,eAAe,GAAG,YAAY,CAAC,eAAe,CA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mB,GAAG,mBAAmB,CAAC;YACvD,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,UAAiC,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createSerializer } from \"@azure/core-client\";\nimport { CloudEvent, cloudEventReservedPropertyNames } from \"./models\";\nimport { CloudEvent as CloudEventMapper, parseAndWrap, validateCloudEventEvent } from \"./util\";\n\nconst serializer = createSerializer();\n\n/**\n * EventGridDeserializer is used to aid in processing events delivered by EventGrid. It can deserialize a JSON encoded payload\n * of either a single event or batch of events as well as be used to convert the result of `JSON.parse` into an\n * `EventGridEvent` or `CloudEvent` like object.\n *\n * Unlike normal JSON deseralization, EventGridDeserializer does some additional conversions:\n *\n * - The consumer parses the event time property into a `Date` object, for ease of use.\n * - When deserializing an event in the CloudEvent schema, if the event contains binary data, it is base64 decoded\n * and returned as an instance of the `Uint8Array` type.\n */\nexport class EventGridDeserializer {\n /**\n * Deserializes events encoded in the Cloud Events 1.0 schema.\n *\n * @param encodedEvents - the JSON encoded representation of either a single event or an array of\n * events, encoded in the Cloud Events 1.0 Schema.\n */\n public async deserializeCloudEvents(encodedEvents: string): Promise<CloudEvent<unknown>[]>;\n\n /**\n * Deserializes events encoded in the Cloud Events 1.0 schema.\n *\n * @param encodedEvents - an object representing a single event, encoded in the Cloud Events 1.0 schema.\n */\n public async deserializeCloudEvents(\n encodedEvents: Record<string, unknown>,\n ): Promise<CloudEvent<unknown>[]>;\n public async deserializeCloudEvents(\n encodedEvents: string | Record<string, unknown>,\n ): Promise<CloudEvent<unknown>[]> {\n const decodedArray = parseAndWrap(encodedEvents);\n\n const events: CloudEvent<unknown>[] = [];\n\n for (const o of decodedArray) {\n validateCloudEventEvent(o);\n\n // Check that the required fields are present and of the correct type and the optional fields are missing\n // or of the correct type.\n\n const deserialized = serializer.deserialize(CloudEventMapper, o, \"\");\n const modelEvent: Record<string, any> = {\n specversion: deserialized.specversion,\n id: deserialized.id,\n source: deserialized.source,\n type: deserialized.type,\n };\n\n if (deserialized.datacontenttype !== undefined) {\n modelEvent.datacontenttype = deserialized.datacontenttype;\n }\n\n if (deserialized.dataschema !== undefined) {\n modelEvent.dataschema = deserialized.dataschema;\n }\n\n if (deserialized.subject !== undefined) {\n modelEvent.subject = deserialized.subject;\n }\n\n if (deserialized.time !== undefined) {\n modelEvent.time = deserialized.time;\n }\n\n if (deserialized.data !== undefined) {\n modelEvent.data = deserialized.data;\n }\n\n // If the data the event represents binary, it is encoded as base64 text in a different property on the event and we need to transform it.\n if (deserialized.dataBase64 !== undefined) {\n if (deserialized.data !== undefined) {\n throw new TypeError(\"event contains both a data and data_base64 field\");\n }\n\n if (!(deserialized.dataBase64 instanceof Uint8Array)) {\n throw new TypeError(\"event data_base64 property is not an instance of Uint8Array\");\n }\n\n modelEvent.data = deserialized.dataBase64;\n }\n\n // Build the \"extensionsAttributes\" property bag by removing all known top level properties.\n const extensionAttributes = { ...deserialized };\n for (const propName of cloudEventReservedPropertyNames) {\n delete extensionAttributes[propName];\n }\n delete extensionAttributes.dataBase64;\n\n // If any properties remain, copy them to the model.\n if (Object.keys(extensionAttributes).length > 0) {\n modelEvent.extensionAttributes = extensionAttributes;\n }\n\n events.push(modelEvent as CloudEvent<unknown>);\n }\n\n return events;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  import { isUnexpected, } from "./cadl-generated/rest/index";
4
4
  import { operationOptionsToRequestParameters } from "@azure-rest/core-client";
5
5
  // eslint-disable-next-line @typescript-eslint/no-redeclare
@@ -1 +1 @@
1
- {"version":3,"file":"eventGridNamespacesPublishBinaryMode.js","sourceRoot":"","sources":["../../src/eventGridNamespacesPublishBinaryMode.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,YAAY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AC,GAAG,KAAK,CAAC,eAAe,CAAC;IACxD,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;IACxC,CAAC;IAED,IAAI,IAAS,CAAC;IACd,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,6BAA6B;QAC7B,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACrB,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAC,IAAI,iCAC7D,mCAAmC,CAAC,OAAO,CAAC,KAC/C,WAAW,EAAE,MAAC,OAAO,CAAC,WAAmB,mCAAI,6CAA6C,EAC1F,OAAO,EACP,IAAI,EAAE;YACJ,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,IAAI;YACJ,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,WAAW,EAAE;YAC/B,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,IACD,CAAC;AACL,CAAC","sourcesContent":["// 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 { PublishCloudEventOptionalParams } from \"./cadl-generated/models/options\";\nimport { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\n// eslint-disable-next-line @typescript-eslint/no-redeclare\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: PublishCloudEventOptionalParams = { 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: PublishCloudEventOptionalParams = { 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"]}
1
+ {"version":3,"file":"eventGridNamespacesPublishBinaryMode.js","sourceRoot":"","sources":["../../src/eventGridNamespacesPublishBinaryMode.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,YAAY,GAIb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAoB,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAGhG,2DAA2D;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAAe,EACf,SAAiB,EACjB,KAAiB,EACjB,UAA2C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEjE,MAAM,MAAM,GAAG,MAAM,gCAAgC,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC1F,OAAO,6BAA6B,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,MAAuE;IAEvE,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,CAAC,IAAI,CAAC;IACpB,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,OAAe,EACf,SAAiB,EACjB,KAAiB,EACjB,UAA2C,EAAE,cAAc,EAAE,EAAE,EAAE;;IAEjE,MAAM,OAAO,GAAwB;QACnC,OAAO,EAAE,KAAK,CAAC,EAAE;QACjB,WAAW,EAAE,KAAK,CAAC,MAAM;QACzB,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,gBAAgB,EAAE,KAAK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B,IAAI,EAAE,MAAA,KAAK,CAAC,IAAI,0CAAE,WAAW,EAAE;YAC/B,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,IACD,CAAC;AACL,CAAC","sourcesContent":["// 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 { PublishCloudEventOptionalParams } from \"./cadl-generated/models/options\";\nimport { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\n// eslint-disable-next-line @typescript-eslint/no-redeclare\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: PublishCloudEventOptionalParams = { 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: PublishCloudEventOptionalParams = { 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"]}