@azure/eventgrid-namespaces 1.0.2-alpha.20260227.1 → 1.0.2-alpha.20260303.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/browser/generated/api/index.d.ts +2 -2
  2. package/dist/browser/generated/api/index.d.ts.map +1 -1
  3. package/dist/browser/generated/api/index.js.map +1 -1
  4. package/dist/browser/generated/eventGridClient.d.ts +1 -1
  5. package/dist/browser/generated/eventGridClient.d.ts.map +1 -1
  6. package/dist/browser/generated/eventGridClient.js.map +1 -1
  7. package/dist/browser/generated/index.d.ts +2 -2
  8. package/dist/browser/generated/index.d.ts.map +1 -1
  9. package/dist/browser/generated/index.js.map +1 -1
  10. package/dist/browser/generated/models/index.d.ts +1 -1
  11. package/dist/browser/generated/models/index.d.ts.map +1 -1
  12. package/dist/browser/generated/models/index.js.map +1 -1
  13. package/dist/browser/index.d.ts +4 -4
  14. package/dist/browser/index.d.ts.map +1 -1
  15. package/dist/browser/index.js.map +1 -1
  16. package/dist/commonjs/cloudEventDistrubtedTracingEnricherPolicy.js +53 -55
  17. package/dist/commonjs/cloudEventDistrubtedTracingEnricherPolicy.js.map +7 -1
  18. package/dist/commonjs/consumer.js +72 -73
  19. package/dist/commonjs/consumer.js.map +7 -1
  20. package/dist/commonjs/eventGridReceiverClient.js +132 -105
  21. package/dist/commonjs/eventGridReceiverClient.js.map +7 -1
  22. package/dist/commonjs/eventGridSenderClient.js +89 -81
  23. package/dist/commonjs/eventGridSenderClient.js.map +7 -1
  24. package/dist/commonjs/generated/api/eventGridContext.js +62 -48
  25. package/dist/commonjs/generated/api/eventGridContext.js.map +7 -1
  26. package/dist/commonjs/generated/api/index.d.ts +2 -2
  27. package/dist/commonjs/generated/api/index.d.ts.map +1 -1
  28. package/dist/commonjs/generated/api/index.js +31 -16
  29. package/dist/commonjs/generated/api/index.js.map +7 -1
  30. package/dist/commonjs/generated/api/operations.js +276 -206
  31. package/dist/commonjs/generated/api/operations.js.map +7 -1
  32. package/dist/commonjs/generated/api/options.js +15 -5
  33. package/dist/commonjs/generated/api/options.js.map +7 -1
  34. package/dist/commonjs/generated/eventGridClient.d.ts +1 -1
  35. package/dist/commonjs/generated/eventGridClient.d.ts.map +1 -1
  36. package/dist/commonjs/generated/eventGridClient.js +94 -52
  37. package/dist/commonjs/generated/eventGridClient.js.map +7 -1
  38. package/dist/commonjs/generated/index.d.ts +2 -2
  39. package/dist/commonjs/generated/index.d.ts.map +1 -1
  40. package/dist/commonjs/generated/index.js +26 -11
  41. package/dist/commonjs/generated/index.js.map +7 -1
  42. package/dist/commonjs/generated/logger.js +24 -8
  43. package/dist/commonjs/generated/logger.js.map +7 -1
  44. package/dist/commonjs/generated/models/index.d.ts +1 -1
  45. package/dist/commonjs/generated/models/index.d.ts.map +1 -1
  46. package/dist/commonjs/generated/models/index.js +24 -9
  47. package/dist/commonjs/generated/models/index.js.map +7 -1
  48. package/dist/commonjs/generated/models/models.js +136 -124
  49. package/dist/commonjs/generated/models/models.js.map +7 -1
  50. package/dist/commonjs/generated/static-helpers/urlTemplate.js +145 -148
  51. package/dist/commonjs/generated/static-helpers/urlTemplate.js.map +7 -1
  52. package/dist/commonjs/index.d.ts +4 -4
  53. package/dist/commonjs/index.d.ts.map +1 -1
  54. package/dist/commonjs/index.js +31 -16
  55. package/dist/commonjs/index.js.map +7 -1
  56. package/dist/commonjs/models.js +32 -16
  57. package/dist/commonjs/models.js.map +7 -1
  58. package/dist/commonjs/util.js +144 -145
  59. package/dist/commonjs/util.js.map +7 -1
  60. package/dist/esm/cloudEventDistrubtedTracingEnricherPolicy.js +35 -52
  61. package/dist/esm/cloudEventDistrubtedTracingEnricherPolicy.js.map +7 -1
  62. package/dist/esm/consumer.js +50 -66
  63. package/dist/esm/consumer.js.map +7 -1
  64. package/dist/esm/eventGridReceiverClient.js +110 -98
  65. package/dist/esm/eventGridReceiverClient.js.map +7 -1
  66. package/dist/esm/eventGridSenderClient.js +67 -73
  67. package/dist/esm/eventGridSenderClient.js.map +7 -1
  68. package/dist/esm/generated/api/eventGridContext.js +44 -44
  69. package/dist/esm/generated/api/eventGridContext.js.map +7 -1
  70. package/dist/esm/generated/api/index.d.ts +2 -2
  71. package/dist/esm/generated/api/index.d.ts.map +1 -1
  72. package/dist/esm/generated/api/index.js +22 -5
  73. package/dist/esm/generated/api/index.js.map +7 -1
  74. package/dist/esm/generated/api/operations.js +301 -215
  75. package/dist/esm/generated/api/operations.js.map +7 -1
  76. package/dist/esm/generated/api/options.js +0 -4
  77. package/dist/esm/generated/api/options.js.map +7 -1
  78. package/dist/esm/generated/eventGridClient.d.ts +1 -1
  79. package/dist/esm/generated/eventGridClient.d.ts.map +1 -1
  80. package/dist/esm/generated/eventGridClient.js +86 -49
  81. package/dist/esm/generated/eventGridClient.js.map +7 -1
  82. package/dist/esm/generated/index.d.ts +2 -2
  83. package/dist/esm/generated/index.d.ts.map +1 -1
  84. package/dist/esm/generated/index.js +10 -5
  85. package/dist/esm/generated/index.js.map +7 -1
  86. package/dist/esm/generated/logger.js +4 -4
  87. package/dist/esm/generated/logger.js.map +7 -1
  88. package/dist/esm/generated/models/index.d.ts +1 -1
  89. package/dist/esm/generated/models/index.d.ts.map +1 -1
  90. package/dist/esm/generated/models/index.js +8 -4
  91. package/dist/esm/generated/models/index.js.map +7 -1
  92. package/dist/esm/generated/models/models.js +131 -120
  93. package/dist/esm/generated/models/models.js.map +7 -1
  94. package/dist/esm/generated/static-helpers/urlTemplate.js +126 -145
  95. package/dist/esm/generated/static-helpers/urlTemplate.js.map +7 -1
  96. package/dist/esm/index.d.ts +4 -4
  97. package/dist/esm/index.d.ts.map +1 -1
  98. package/dist/esm/index.js +14 -8
  99. package/dist/esm/index.js.map +7 -1
  100. package/dist/esm/models.js +13 -13
  101. package/dist/esm/models.js.map +7 -1
  102. package/dist/esm/util.js +129 -142
  103. package/dist/esm/util.js.map +7 -1
  104. package/dist/react-native/generated/api/index.d.ts +2 -2
  105. package/dist/react-native/generated/api/index.d.ts.map +1 -1
  106. package/dist/react-native/generated/api/index.js.map +1 -1
  107. package/dist/react-native/generated/eventGridClient.d.ts +1 -1
  108. package/dist/react-native/generated/eventGridClient.d.ts.map +1 -1
  109. package/dist/react-native/generated/eventGridClient.js.map +1 -1
  110. package/dist/react-native/generated/index.d.ts +2 -2
  111. package/dist/react-native/generated/index.d.ts.map +1 -1
  112. package/dist/react-native/generated/index.js.map +1 -1
  113. package/dist/react-native/generated/models/index.d.ts +1 -1
  114. package/dist/react-native/generated/models/index.d.ts.map +1 -1
  115. package/dist/react-native/generated/models/index.js.map +1 -1
  116. package/dist/react-native/index.d.ts +4 -4
  117. package/dist/react-native/index.d.ts.map +1 -1
  118. package/dist/react-native/index.js.map +1 -1
  119. package/package.json +4 -21
  120. package/dist/browser/generated/metadata.json +0 -4
  121. package/dist/commonjs/generated/metadata.json +0 -4
  122. package/dist/esm/generated/metadata.json +0 -4
  123. package/dist/react-native/generated/metadata.json +0 -4
@@ -1,4 +1,4 @@
1
- export { createEventGrid, EventGridContext, EventGridClientOptionalParams, } from "./eventGridContext.js";
1
+ export { createEventGrid, type EventGridContext, type EventGridClientOptionalParams, } from "./eventGridContext.js";
2
2
  export { renewCloudEventLocks, rejectCloudEvents, releaseCloudEvents, acknowledgeCloudEvents, receiveCloudEvents, publishCloudEvents, publishCloudEvent, } from "./operations.js";
3
- export { RenewCloudEventLocksOptionalParams, RejectCloudEventsOptionalParams, ReleaseCloudEventsOptionalParams, AcknowledgeCloudEventsOptionalParams, ReceiveCloudEventsOptionalParams, PublishCloudEventsOptionalParams, PublishCloudEventOptionalParams, } from "./options.js";
3
+ export { type RenewCloudEventLocksOptionalParams, type RejectCloudEventsOptionalParams, type ReleaseCloudEventsOptionalParams, type AcknowledgeCloudEventsOptionalParams, type ReceiveCloudEventsOptionalParams, type PublishCloudEventsOptionalParams, type PublishCloudEventOptionalParams, } from "./options.js";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/api/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kCAAkC,EAClC,+BAA+B,EAC/B,gCAAgC,EAChC,oCAAoC,EACpC,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,GAChC,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/api/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,6BAA6B,GACnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,KAAK,oCAAoC,EACzC,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,GACrC,MAAM,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/api/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,eAAe,GAGhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n createEventGrid,\n EventGridContext,\n EventGridClientOptionalParams,\n} from \"./eventGridContext.js\";\nexport {\n renewCloudEventLocks,\n rejectCloudEvents,\n releaseCloudEvents,\n acknowledgeCloudEvents,\n receiveCloudEvents,\n publishCloudEvents,\n publishCloudEvent,\n} from \"./operations.js\";\nexport {\n RenewCloudEventLocksOptionalParams,\n RejectCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n PublishCloudEventsOptionalParams,\n PublishCloudEventOptionalParams,\n} from \"./options.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/api/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,eAAe,GAGhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n createEventGrid,\n type EventGridContext,\n type EventGridClientOptionalParams,\n} from \"./eventGridContext.js\";\nexport {\n renewCloudEventLocks,\n rejectCloudEvents,\n releaseCloudEvents,\n acknowledgeCloudEvents,\n receiveCloudEvents,\n publishCloudEvents,\n publishCloudEvent,\n} from \"./operations.js\";\nexport {\n type RenewCloudEventLocksOptionalParams,\n type RejectCloudEventsOptionalParams,\n type ReleaseCloudEventsOptionalParams,\n type AcknowledgeCloudEventsOptionalParams,\n type ReceiveCloudEventsOptionalParams,\n type PublishCloudEventsOptionalParams,\n type PublishCloudEventOptionalParams,\n} from \"./options.js\";\n"]}
@@ -3,7 +3,7 @@ import { CloudEvent, PublishResult, ReceiveResult, AcknowledgeResult, ReleaseRes
3
3
  import { RenewCloudEventLocksOptionalParams, RejectCloudEventsOptionalParams, ReleaseCloudEventsOptionalParams, AcknowledgeCloudEventsOptionalParams, ReceiveCloudEventsOptionalParams, PublishCloudEventsOptionalParams, PublishCloudEventOptionalParams } from "./api/options.js";
4
4
  import { Pipeline } from "@azure/core-rest-pipeline";
5
5
  import { KeyCredential, TokenCredential } from "@azure/core-auth";
6
- export { EventGridClientOptionalParams } from "./api/eventGridContext.js";
6
+ export type { EventGridClientOptionalParams } from "./api/eventGridContext.js";
7
7
  export declare class EventGridClient {
8
8
  private _client;
9
9
  /** The pipeline used by this client to make requests */
@@ -1 +1 @@
1
- {"version":3,"file":"eventGridClient.d.ts","sourceRoot":"","sources":["../../../src/generated/eventGridClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,6BAA6B,EAC9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kCAAkC,EAClC,+BAA+B,EAC/B,gCAAgC,EAChC,oCAAoC,EACpC,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,EAChC,MAAM,kBAAkB,CAAC;AAU1B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAE1E,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAmB;IAClC,wDAAwD;IACxD,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IAEnC,uCAAuC;gBAErC,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,aAAa,GAAG,eAAe,EAC3C,OAAO,GAAE,6BAAkC;IAa7C,sUAAsU;IACtU,oBAAoB,CAClB,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,EAC7B,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,GAAE,kCAA2D,GACnE,OAAO,CAAC,gBAAgB,CAAC;IAU5B,8RAA8R;IAC9R,iBAAiB,CACf,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,EAC7B,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,GAAE,+BAAwD,GAChE,OAAO,CAAC,YAAY,CAAC;IAUxB,0PAA0P;IAC1P,kBAAkB,CAChB,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,EAC7B,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,GAAE,gCAAyD,GACjE,OAAO,CAAC,aAAa,CAAC;IAUzB,oSAAoS;IACpS,sBAAsB,CACpB,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,EAC7B,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,GAAE,oCAA6D,GACrE,OAAO,CAAC,iBAAiB,CAAC;IAU7B,2DAA2D;IAC3D,kBAAkB,CAChB,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,EAC7B,OAAO,GAAE,gCAAyD,GACjE,OAAO,CAAC,aAAa,CAAC;IASzB,4DAA4D;IAC5D,kBAAkB,CAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,UAAU,EAAE,EACpB,OAAO,GAAE,gCAAyD,GACjE,OAAO,CAAC,aAAa,CAAC;IAIzB,yDAAyD;IACzD,iBAAiB,CACf,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,+BAAwD,GAChE,OAAO,CAAC,aAAa,CAAC;CAG1B"}
1
+ {"version":3,"file":"eventGridClient.d.ts","sourceRoot":"","sources":["../../../src/generated/eventGridClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,6BAA6B,EAC9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,iBAA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6D,GACrE,OAAO,CAAC,iBAAiB,CAAC;IAU7B,2DAA2D;IAC3D,kBAAkB,CAChB,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,EAC7B,OAAO,GAAE,gCAAyD,GACjE,OAAO,CAAC,aAAa,CAAC;IASzB,4DAA4D;IAC5D,kBAAkB,CAChB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,UAAU,EAAE,EACpB,OAAO,GAAE,gCAAyD,GACjE,OAAO,CAAC,aAAa,CAAC;IAIzB,yDAAyD;IACzD,iBAAiB,CACf,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,+BAAwD,GAChE,OAAO,CAAC,aAAa,CAAC;CAG1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"eventGridClient.js","sourceRoot":"","sources":["../../../src/generated/eventGridClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,eAAe,GAGhB,MAAM,gBAAgB,CAAC;AAmBxB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAM7B,MAAM,OAAO,eAAe;IAClB,OAAO,CAAmB;IAClC,wDAAwD;IACxC,QAAQ,CAAW;IAEnC,uCAAuC;IACvC,YACE,aAAqB,EACrB,UAA2C,EAC3C,UAAyC,EAAE;QAE3C,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;QACrE,MAAM,eAAe,GAAG,iBAAiB;YACvC,CAAC,CAAC,GAAG,iBAAiB,kBAAkB;YACxC,CAAC,CAAC,iBAAiB,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,aAAa,EAAE,UAAU,EAAE;YACxD,GAAG,OAAO;YACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;SACtC,CAAC,CAAC;QAC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CAChB,SAAiB,EACjB,MAAoB,EACpB,UAA4C,EAAE,cAAc,EAAE,EAAE,EAAE;QAElE,OAAO,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED,yDAAyD;IACzD,iBAAiB,CACf,SAAiB,EACjB,KAAiB,EACjB,UAA2C,EAAE,cAAc,EAAE,EAAE,EAAE;QAEjE,OAAO,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n createEventGrid,\n EventGridContext,\n EventGridClientOptionalParams,\n} from \"./api/index.js\";\nimport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n AcknowledgeResult,\n ReleaseResult,\n RejectResult,\n RenewLocksResult,\n} from \"./models/models.js\";\nimport {\n RenewCloudEventLocksOptionalParams,\n RejectCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n PublishCloudEventsOptionalParams,\n PublishCloudEventOptionalParams,\n} from \"./api/options.js\";\nimport {\n renewCloudEventLocks,\n rejectCloudEvents,\n releaseCloudEvents,\n acknowledgeCloudEvents,\n receiveCloudEvents,\n publishCloudEvents,\n publishCloudEvent,\n} from \"./api/operations.js\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { KeyCredential, TokenCredential } from \"@azure/core-auth\";\n\nexport { EventGridClientOptionalParams } from \"./api/eventGridContext.js\";\n\nexport class EventGridClient {\n private _client: EventGridContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n /** Azure Messaging EventGrid Client */\n constructor(\n endpointParam: string,\n credential: KeyCredential | TokenCredential,\n options: EventGridClientOptionalParams = {},\n ) {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createEventGrid(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\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. */\n renewCloudEventLocks(\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RenewCloudEventLocksOptionalParams = { requestOptions: {} },\n ): Promise<RenewLocksResult> {\n return renewCloudEventLocks(\n this._client,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\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. */\n rejectCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RejectCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<RejectResult> {\n return rejectCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\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. */\n releaseCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: ReleaseCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<ReleaseResult> {\n return releaseCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\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. */\n acknowledgeCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: AcknowledgeCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<AcknowledgeResult> {\n return acknowledgeCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n }\n\n /** Receive a batch of Cloud Events from a subscription. */\n receiveCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<ReceiveResult> {\n return receiveCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n options,\n );\n }\n\n /** Publish a batch of Cloud Events to a namespace topic. */\n publishCloudEvents(\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<PublishResult> {\n return publishCloudEvents(this._client, topicName, events, options);\n }\n\n /** Publish a single Cloud Event to a namespace topic. */\n publishCloudEvent(\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptionalParams = { requestOptions: {} },\n ): Promise<PublishResult> {\n return publishCloudEvent(this._client, topicName, event, options);\n }\n}\n"]}
1
+ {"version":3,"file":"eventGridClient.js","sourceRoot":"","sources":["../../../src/generated/eventGridClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,eAAe,GAGhB,MAAM,gBAAgB,CAAC;AAmBxB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAM7B,MAAM,OAAO,eAAe;IAClB,OAAO,CAAmB;IAClC,wDAAwD;IACxC,QAAQ,CAAW;IAEnC,uCAAuC;IACvC,YACE,aAAqB,EACrB,UAA2C,EAC3C,UAAyC,EAAE;QAE3C,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;QACrE,MAAM,eAAe,GAAG,iBAAiB;YACvC,CAAC,CAAC,GAAG,iBAAiB,kBAAkB;YACxC,CAAC,CAAC,iBAAiB,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,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ACvB,IAAI,CAAC,OAAO,EACZ,SAAS,EACT,qBAAqB,EACrB,OAAO,CACR,CAAC;IACJ,CAAC;IAED,4DAA4D;IAC5D,kBAAkB,CAChB,SAAiB,EACjB,MAAoB,EACpB,UAA4C,EAAE,cAAc,EAAE,EAAE,EAAE;QAElE,OAAO,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAED,yDAAyD;IACzD,iBAAiB,CACf,SAAiB,EACjB,KAAiB,EACjB,UAA2C,EAAE,cAAc,EAAE,EAAE,EAAE;QAEjE,OAAO,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n createEventGrid,\n EventGridContext,\n EventGridClientOptionalParams,\n} from \"./api/index.js\";\nimport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n AcknowledgeResult,\n ReleaseResult,\n RejectResult,\n RenewLocksResult,\n} from \"./models/models.js\";\nimport {\n RenewCloudEventLocksOptionalParams,\n RejectCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n PublishCloudEventsOptionalParams,\n PublishCloudEventOptionalParams,\n} from \"./api/options.js\";\nimport {\n renewCloudEventLocks,\n rejectCloudEvents,\n releaseCloudEvents,\n acknowledgeCloudEvents,\n receiveCloudEvents,\n publishCloudEvents,\n publishCloudEvent,\n} from \"./api/operations.js\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { KeyCredential, TokenCredential } from \"@azure/core-auth\";\n\nexport type { EventGridClientOptionalParams } from \"./api/eventGridContext.js\";\n\nexport class EventGridClient {\n private _client: EventGridContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n /** Azure Messaging EventGrid Client */\n constructor(\n endpointParam: string,\n credential: KeyCredential | TokenCredential,\n options: EventGridClientOptionalParams = {},\n ) {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createEventGrid(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\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. */\n renewCloudEventLocks(\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RenewCloudEventLocksOptionalParams = { requestOptions: {} },\n ): Promise<RenewLocksResult> {\n return renewCloudEventLocks(\n this._client,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\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. */\n rejectCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: RejectCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<RejectResult> {\n return rejectCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\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. */\n releaseCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: ReleaseCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<ReleaseResult> {\n return releaseCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\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. */\n acknowledgeCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n lockTokens: string[],\n options: AcknowledgeCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<AcknowledgeResult> {\n return acknowledgeCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n lockTokens,\n options,\n );\n }\n\n /** Receive a batch of Cloud Events from a subscription. */\n receiveCloudEvents(\n topicName: string,\n eventSubscriptionName: string,\n options: ReceiveCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<ReceiveResult> {\n return receiveCloudEvents(\n this._client,\n topicName,\n eventSubscriptionName,\n options,\n );\n }\n\n /** Publish a batch of Cloud Events to a namespace topic. */\n publishCloudEvents(\n topicName: string,\n events: CloudEvent[],\n options: PublishCloudEventsOptionalParams = { requestOptions: {} },\n ): Promise<PublishResult> {\n return publishCloudEvents(this._client, topicName, events, options);\n }\n\n /** Publish a single Cloud Event to a namespace topic. */\n publishCloudEvent(\n topicName: string,\n event: CloudEvent,\n options: PublishCloudEventOptionalParams = { requestOptions: {} },\n ): Promise<PublishResult> {\n return publishCloudEvent(this._client, topicName, event, options);\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export { EventGridClient } from "./eventGridClient.js";
2
- export { CloudEvent, PublishResult, ReceiveResult, ReceiveDetails, BrokerProperties, AcknowledgeResult, FailedLockToken, ReleaseResult, RejectResult, RenewLocksResult, KnownReleaseDelay, ReleaseDelay, KnownServiceApiVersions, } from "./models/index.js";
3
- export { EventGridClientOptionalParams, RenewCloudEventLocksOptionalParams, RejectCloudEventsOptionalParams, ReleaseCloudEventsOptionalParams, AcknowledgeCloudEventsOptionalParams, ReceiveCloudEventsOptionalParams, PublishCloudEventsOptionalParams, PublishCloudEventOptionalParams, } from "./api/index.js";
2
+ export { type CloudEvent, type PublishResult, type ReceiveResult, type ReceiveDetails, type BrokerProperties, type AcknowledgeResult, type FailedLockToken, type ReleaseResult, type RejectResult, type RenewLocksResult, KnownReleaseDelay, type ReleaseDelay, KnownServiceApiVersions, } from "./models/index.js";
3
+ export { type EventGridClientOptionalParams, type RenewCloudEventLocksOptionalParams, type RejectCloudEventsOptionalParams, type ReleaseCloudEventsOptionalParams, type AcknowledgeCloudEventsOptionalParams, type ReceiveCloudEventsOptionalParams, type PublishCloudEventsOptionalParams, type PublishCloudEventOptionalParams, } from "./api/index.js";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,6BAA6B,EAC7B,kCAAkC,EAClC,+BAA+B,EAC/B,gCAAgC,EAChC,oCAAoC,EACpC,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,GAChC,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,iBAAiB,EACjB,KAAK,YAAY,EACjB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,kCAAkC,EACvC,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,KAAK,oCAAoC,EACzC,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,GACrC,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAWL,iBAAiB,EAEjB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { EventGridClient } from \"./eventGridClient.js\";\nexport {\n CloudEvent,\n PublishResult,\n ReceiveResult,\n ReceiveDetails,\n BrokerProperties,\n AcknowledgeResult,\n FailedLockToken,\n ReleaseResult,\n RejectResult,\n RenewLocksResult,\n KnownReleaseDelay,\n ReleaseDelay,\n KnownServiceApiVersions,\n} from \"./models/index.js\";\nexport {\n EventGridClientOptionalParams,\n RenewCloudEventLocksOptionalParams,\n RejectCloudEventsOptionalParams,\n ReleaseCloudEventsOptionalParams,\n AcknowledgeCloudEventsOptionalParams,\n ReceiveCloudEventsOptionalParams,\n PublishCloudEventsOptionalParams,\n PublishCloudEventOptionalParams,\n} from \"./api/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAWL,iBAAiB,EAEjB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { EventGridClient } from \"./eventGridClient.js\";\nexport {\n type CloudEvent,\n type PublishResult,\n type ReceiveResult,\n type ReceiveDetails,\n type BrokerProperties,\n type AcknowledgeResult,\n type FailedLockToken,\n type ReleaseResult,\n type RejectResult,\n type RenewLocksResult,\n KnownReleaseDelay,\n type ReleaseDelay,\n KnownServiceApiVersions,\n} from \"./models/index.js\";\nexport {\n type EventGridClientOptionalParams,\n type RenewCloudEventLocksOptionalParams,\n type RejectCloudEventsOptionalParams,\n type ReleaseCloudEventsOptionalParams,\n type AcknowledgeCloudEventsOptionalParams,\n type ReceiveCloudEventsOptionalParams,\n type PublishCloudEventsOptionalParams,\n type PublishCloudEventOptionalParams,\n} from \"./api/index.js\";\n"]}
@@ -1,2 +1,2 @@
1
- export { CloudEvent, PublishResult, ReceiveResult, ReceiveDetails, BrokerProperties, AcknowledgeResult, FailedLockToken, ReleaseResult, RejectResult, RenewLocksResult, KnownReleaseDelay, ReleaseDelay, KnownServiceApiVersions, } from "./models.js";
1
+ export { type CloudEvent, type PublishResult, type ReceiveResult, type ReceiveDetails, type BrokerProperties, type AcknowledgeResult, type FailedLockToken, type ReleaseResult, type RejectResult, type RenewLocksResult, KnownReleaseDelay, type ReleaseDelay, KnownServiceApiVersions, } from "./models.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/models/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,GACxB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/models/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,iBAAiB,EACjB,KAAK,YAAY,EACjB,uBAAuB,GACxB,MAAM,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAWL,iBAAiB,EAEjB,uBAAuB,GACxB,MAAM,aAAa,CAAC","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 ReleaseResult,\n RejectResult,\n RenewLocksResult,\n KnownReleaseDelay,\n ReleaseDelay,\n KnownServiceApiVersions,\n} from \"./models.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAWL,iBAAiB,EAEjB,uBAAuB,GACxB,MAAM,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n type CloudEvent,\n type PublishResult,\n type ReceiveResult,\n type ReceiveDetails,\n type BrokerProperties,\n type AcknowledgeResult,\n type FailedLockToken,\n type ReleaseResult,\n type RejectResult,\n type RenewLocksResult,\n KnownReleaseDelay,\n type ReleaseDelay,\n KnownServiceApiVersions,\n} from \"./models.js\";\n"]}
@@ -1,9 +1,9 @@
1
1
  export { AzureKeyCredential } from "@azure/core-auth";
2
- export { BrokerProperties, AcknowledgeResult, FailedLockToken, ReleaseResult, RejectResult, ReleaseDelay, KnownReleaseDelay, RenewLocksResult, AcknowledgeCloudEventsOptionalParams as AcknowledgeEventsOptionalParams, ReceiveCloudEventsOptionalParams as ReceiveEventsOptionalParams, RejectCloudEventsOptionalParams as RejectEventsOptionalParams, RenewCloudEventLocksOptionalParams as RenewEventLocksOptionalParams, PublishCloudEventsOptionalParams as SendEventsOptionalParams, PublishCloudEventOptionalParams as SendEventOptionalParams, } from "./generated/index.js";
2
+ export { type BrokerProperties, type AcknowledgeResult, type FailedLockToken, type ReleaseResult, type RejectResult, type ReleaseDelay, KnownReleaseDelay, type RenewLocksResult, type AcknowledgeCloudEventsOptionalParams as AcknowledgeEventsOptionalParams, type ReceiveCloudEventsOptionalParams as ReceiveEventsOptionalParams, type RejectCloudEventsOptionalParams as RejectEventsOptionalParams, type RenewCloudEventLocksOptionalParams as RenewEventLocksOptionalParams, type PublishCloudEventsOptionalParams as SendEventsOptionalParams, type PublishCloudEventOptionalParams as SendEventOptionalParams, } from "./generated/index.js";
3
3
  export { EventGridSenderClient } from "./eventGridSenderClient.js";
4
4
  export { EventGridReceiverClient } from "./eventGridReceiverClient.js";
5
- export { EventGridClientOptionalParams as EventGridClientOptions } from "./generated/index.js";
6
- export { OperationOptions } from "@azure-rest/core-client";
7
- export { CloudEvent, SendEventsOptions, ReceiveResult, ReceiveDetails, ReceiveEventsOptions, AcknowledgeEventsOptions, ReleaseEventsOptions, RejectEventsOptions, RenewEventLocksOptions, EventGridSenderClientOptions, EventGridReceiverClientOptions, } from "./models.js";
5
+ export type { EventGridClientOptionalParams as EventGridClientOptions } from "./generated/index.js";
6
+ export type { OperationOptions } from "@azure-rest/core-client";
7
+ export type { CloudEvent, SendEventsOptions, ReceiveResult, ReceiveDetails, ReceiveEventsOptions, AcknowledgeEventsOptions, ReleaseEventsOptions, RejectEventsOptions, RenewEventLocksOptions, EventGridSenderClientOptions, EventGridReceiverClientOptions, } from "./models.js";
8
8
  export { EventGridDeserializer } from "./consumer.js";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,YAAY,E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AE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,YAAY,EAAE,6BAA6B,IAAI,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEpG,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAOL,iBAAiB,GAQlB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAoBvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\n\nexport {\n BrokerProperties,\n AcknowledgeResult,\n FailedLockToken,\n ReleaseResult,\n RejectResult,\n ReleaseDelay,\n KnownReleaseDelay,\n RenewLocksResult,\n AcknowledgeCloudEventsOptionalParams as AcknowledgeEventsOptionalParams,\n ReceiveCloudEventsOptionalParams as ReceiveEventsOptionalParams,\n RejectCloudEventsOptionalParams as RejectEventsOptionalParams,\n RenewCloudEventLocksOptionalParams as RenewEventLocksOptionalParams,\n PublishCloudEventsOptionalParams as SendEventsOptionalParams,\n PublishCloudEventOptionalParams as SendEventOptionalParams,\n} from \"./generated/index.js\";\n\nexport { EventGridSenderClient } from \"./eventGridSenderClient.js\";\n\nexport { EventGridReceiverClient } from \"./eventGridReceiverClient.js\";\n\nexport { EventGridClientOptionalParams as EventGridClientOptions } from \"./generated/index.js\";\n\nexport { OperationOptions } from \"@azure-rest/core-client\";\n\nexport {\n CloudEvent,\n SendEventsOptions,\n ReceiveResult,\n ReceiveDetails,\n ReceiveEventsOptions,\n AcknowledgeEventsOptions,\n ReleaseEventsOptions,\n RejectEventsOptions,\n RenewEventLocksOptions,\n EventGridSenderClientOptions,\n EventGridReceiverClientOptions,\n} from \"./models.js\";\n\nexport { EventGridDeserializer } from \"./consumer.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAOL,iBAAiB,GAQlB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAoBvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { AzureKeyCredential } from \"@azure/core-auth\";\n\nexport {\n type BrokerProperties,\n type AcknowledgeResult,\n type FailedLockToken,\n type ReleaseResult,\n type RejectResult,\n type ReleaseDelay,\n KnownReleaseDelay,\n type RenewLocksResult,\n type AcknowledgeCloudEventsOptionalParams as AcknowledgeEventsOptionalParams,\n type ReceiveCloudEventsOptionalParams as ReceiveEventsOptionalParams,\n type RejectCloudEventsOptionalParams as RejectEventsOptionalParams,\n type RenewCloudEventLocksOptionalParams as RenewEventLocksOptionalParams,\n type PublishCloudEventsOptionalParams as SendEventsOptionalParams,\n type PublishCloudEventOptionalParams as SendEventOptionalParams,\n} from \"./generated/index.js\";\n\nexport { EventGridSenderClient } from \"./eventGridSenderClient.js\";\n\nexport { EventGridReceiverClient } from \"./eventGridReceiverClient.js\";\n\nexport type { EventGridClientOptionalParams as EventGridClientOptions } from \"./generated/index.js\";\n\nexport type { OperationOptions } from \"@azure-rest/core-client\";\n\nexport type {\n CloudEvent,\n SendEventsOptions,\n ReceiveResult,\n ReceiveDetails,\n ReceiveEventsOptions,\n AcknowledgeEventsOptions,\n ReleaseEventsOptions,\n RejectEventsOptions,\n RenewEventLocksOptions,\n EventGridSenderClientOptions,\n EventGridReceiverClientOptions,\n} from \"./models.js\";\n\nexport { EventGridDeserializer } from \"./consumer.js\";\n"]}
@@ -1,57 +1,55 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.cloudEventDistributedTracingEnricherPolicyName = exports.ContentTypeHeaderName = exports.TraceStateHeaderName = exports.TraceParentHeaderName = exports.CloudEventBatchContentType = void 0;
6
- exports.cloudEventDistributedTracingEnricherPolicy = cloudEventDistributedTracingEnricherPolicy;
7
- exports.CloudEventBatchContentType = "application/cloudevents-batch+json; charset=utf-8";
8
- exports.TraceParentHeaderName = "traceparent";
9
- exports.TraceStateHeaderName = "tracestate";
10
- exports.ContentTypeHeaderName = "Content-Type";
11
- /**
12
- * The programmatic identifier of the cloudEventDistributedTracingEnricherPolicy.
13
- */
14
- exports.cloudEventDistributedTracingEnricherPolicyName = "cloudEventDistributedTracingEnricherPolicy";
15
- /**
16
- * cloudEventDistributedTracingEnricherPolicy is a policy which adds distributed tracing information
17
- * to a batch of cloud events. It does so by copying the `traceparent` and `tracestate` properties
18
- * from the HTTP request into the individual events as extension properties.
19
- *
20
- * This will only happen in the case where an event does not have a `traceparent` defined already. This
21
- * allows events to explicitly set a traceparent and tracestate which would be respected during "multi-hop
22
- * transmition".
23
- *
24
- * See https://github.com/cloudevents/spec/blob/master/extensions/distributed-tracing.md
25
- * for more information on distributed tracing and cloud events.
26
- */
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var cloudEventDistrubtedTracingEnricherPolicy_exports = {};
19
+ __export(cloudEventDistrubtedTracingEnricherPolicy_exports, {
20
+ CloudEventBatchContentType: () => CloudEventBatchContentType,
21
+ ContentTypeHeaderName: () => ContentTypeHeaderName,
22
+ TraceParentHeaderName: () => TraceParentHeaderName,
23
+ TraceStateHeaderName: () => TraceStateHeaderName,
24
+ cloudEventDistributedTracingEnricherPolicy: () => cloudEventDistributedTracingEnricherPolicy,
25
+ cloudEventDistributedTracingEnricherPolicyName: () => cloudEventDistributedTracingEnricherPolicyName
26
+ });
27
+ module.exports = __toCommonJS(cloudEventDistrubtedTracingEnricherPolicy_exports);
28
+ const CloudEventBatchContentType = "application/cloudevents-batch+json; charset=utf-8";
29
+ const TraceParentHeaderName = "traceparent";
30
+ const TraceStateHeaderName = "tracestate";
31
+ const ContentTypeHeaderName = "Content-Type";
32
+ const cloudEventDistributedTracingEnricherPolicyName = "cloudEventDistributedTracingEnricherPolicy";
27
33
  function cloudEventDistributedTracingEnricherPolicy() {
28
- return {
29
- name: exports.cloudEventDistributedTracingEnricherPolicyName,
30
- async sendRequest(request, next) {
31
- const traceparent = request.headers.get(exports.TraceParentHeaderName);
32
- const tracestate = request.headers.get(exports.TraceStateHeaderName);
33
- if (request.headers.get(exports.ContentTypeHeaderName) === exports.CloudEventBatchContentType &&
34
- typeof request.body === "string" &&
35
- traceparent) {
36
- // per the cloud event batched content type we know the body is an array encoded in JSON.
37
- const parsedBody = JSON.parse(request.body);
38
- for (const item of parsedBody) {
39
- // When using the distributed tracing extension, the "traceparent" is a required property
40
- // and "tracestate" is optional. This means if an item already has a "traceparent" property
41
- // we should not stomp over it. Well formed events will not have a "tracestate" without
42
- // also having a "traceparent" so there's no need to guard against that case.
43
- if (typeof item !== "object" || item.traceparent) {
44
- continue;
45
- }
46
- item.traceparent = traceparent;
47
- if (tracestate) {
48
- item.tracestate = tracestate;
49
- }
50
- }
51
- request.body = JSON.stringify(parsedBody);
52
- }
53
- return next(request);
54
- },
55
- };
34
+ return {
35
+ name: cloudEventDistributedTracingEnricherPolicyName,
36
+ async sendRequest(request, next) {
37
+ const traceparent = request.headers.get(TraceParentHeaderName);
38
+ const tracestate = request.headers.get(TraceStateHeaderName);
39
+ if (request.headers.get(ContentTypeHeaderName) === CloudEventBatchContentType && typeof request.body === "string" && traceparent) {
40
+ const parsedBody = JSON.parse(request.body);
41
+ for (const item of parsedBody) {
42
+ if (typeof item !== "object" || item.traceparent) {
43
+ continue;
44
+ }
45
+ item.traceparent = traceparent;
46
+ if (tracestate) {
47
+ item.tracestate = tracestate;
48
+ }
49
+ }
50
+ request.body = JSON.stringify(parsedBody);
51
+ }
52
+ return next(request);
53
+ }
54
+ };
56
55
  }
57
- //# sourceMappingURL=cloudEventDistrubtedTracingEnricherPolicy.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"cloudEventDistrubtedTracingEnricherPolicy.js","sourceRoot":"","sources":["../../src/cloudEventDistrubtedTracingEnricherPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAgClC,gG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,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\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
+ {
2
+ "version": 3,
3
+ "sources": ["/mnt/vss/_work/1/s/sdk/eventgrid/eventgrid-namespaces/src/cloudEventDistrubtedTracingEnricherPolicy.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,MAAM,6BAA6B;AACnC,MAAM,wBAAwB;AAC9B,MAAM,uBAAuB;AAC7B,MAAM,wBAAwB;AAK9B,MAAM,iDACX;AAcK,SAAS,6CAA6D;AAC3E,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM,YAAY,SAA0B,MAA8C;AACxF,YAAM,cAAc,QAAQ,QAAQ,IAAI,qBAAqB;AAC7D,YAAM,aAAa,QAAQ,QAAQ,IAAI,oBAAoB;AAE3D,UACE,QAAQ,QAAQ,IAAI,qBAAqB,MAAM,8BAC/C,OAAO,QAAQ,SAAS,YACxB,aACA;AAEA,cAAM,aAAa,KAAK,MAAM,QAAQ,IAAI;AAE1C,mBAAW,QAAQ,YAAY;AAK7B,cAAI,OAAO,SAAS,YAAY,KAAK,aAAa;AAChD;AAAA,UACF;AAEA,eAAK,cAAc;AACnB,cAAI,YAAY;AACd,iBAAK,aAAa;AAAA,UACpB;AAAA,QACF;AAEA,gBAAQ,OAAO,KAAK,UAAU,UAAU;AAAA,MAC1C;AAEA,aAAO,KAAK,OAAO;AAAA,IACrB;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -1,77 +1,76 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.EventGridDeserializer = void 0;
6
- const core_client_1 = require("@azure/core-client");
7
- const models_js_1 = require("./models.js");
8
- const util_js_1 = require("./util.js");
9
- const serializer = (0, core_client_1.createSerializer)();
10
- /**
11
- * EventGridDeserializer is used to aid in processing events delivered by EventGrid. It can deserialize a JSON encoded payload
12
- * of either a single event or batch of events as well as be used to convert the result of `JSON.parse` into an
13
- * `EventGridEvent` or `CloudEvent` like object.
14
- *
15
- * Unlike normal JSON deseralization, EventGridDeserializer does some additional conversions:
16
- *
17
- * - The consumer parses the event time property into a `Date` object, for ease of use.
18
- * - When deserializing an event in the CloudEvent schema, if the event contains binary data, it is base64 decoded
19
- * and returned as an instance of the `Uint8Array` type.
20
- */
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var consumer_exports = {};
19
+ __export(consumer_exports, {
20
+ EventGridDeserializer: () => EventGridDeserializer
21
+ });
22
+ module.exports = __toCommonJS(consumer_exports);
23
+ var import_core_client = require("@azure/core-client");
24
+ var import_models = require("./models.js");
25
+ var import_util = require("./util.js");
26
+ const serializer = (0, import_core_client.createSerializer)();
21
27
  class EventGridDeserializer {
22
- async deserializeCloudEvents(encodedEvents) {
23
- const decodedArray = (0, util_js_1.parseAndWrap)(encodedEvents);
24
- const events = [];
25
- for (const o of decodedArray) {
26
- (0, util_js_1.validateCloudEventEvent)(o);
27
- // Check that the required fields are present and of the correct type and the optional fields are missing
28
- // or of the correct type.
29
- const deserialized = serializer.deserialize(util_js_1.CloudEvent, o, "");
30
- const modelEvent = {
31
- specversion: deserialized.specversion,
32
- id: deserialized.id,
33
- source: deserialized.source,
34
- type: deserialized.type,
35
- };
36
- if (deserialized.datacontenttype !== undefined) {
37
- modelEvent.datacontenttype = deserialized.datacontenttype;
38
- }
39
- if (deserialized.dataschema !== undefined) {
40
- modelEvent.dataschema = deserialized.dataschema;
41
- }
42
- if (deserialized.subject !== undefined) {
43
- modelEvent.subject = deserialized.subject;
44
- }
45
- if (deserialized.time !== undefined) {
46
- modelEvent.time = deserialized.time;
47
- }
48
- if (deserialized.data !== undefined) {
49
- modelEvent.data = deserialized.data;
50
- }
51
- // 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.
52
- if (deserialized.dataBase64 !== undefined) {
53
- if (deserialized.data !== undefined) {
54
- throw new TypeError("event contains both a data and data_base64 field");
55
- }
56
- if (!(deserialized.dataBase64 instanceof Uint8Array)) {
57
- throw new TypeError("event data_base64 property is not an instance of Uint8Array");
58
- }
59
- modelEvent.data = deserialized.dataBase64;
60
- }
61
- // Build the "extensionsAttributes" property bag by removing all known top level properties.
62
- const extensionAttributes = { ...deserialized };
63
- for (const propName of models_js_1.cloudEventReservedPropertyNames) {
64
- delete extensionAttributes[propName];
65
- }
66
- delete extensionAttributes.dataBase64;
67
- // If any properties remain, copy them to the model.
68
- if (Object.keys(extensionAttributes).length > 0) {
69
- modelEvent.extensionAttributes = extensionAttributes;
70
- }
71
- events.push(modelEvent);
28
+ async deserializeCloudEvents(encodedEvents) {
29
+ const decodedArray = (0, import_util.parseAndWrap)(encodedEvents);
30
+ const events = [];
31
+ for (const o of decodedArray) {
32
+ (0, import_util.validateCloudEventEvent)(o);
33
+ const deserialized = serializer.deserialize(import_util.CloudEvent, o, "");
34
+ const modelEvent = {
35
+ specversion: deserialized.specversion,
36
+ id: deserialized.id,
37
+ source: deserialized.source,
38
+ type: deserialized.type
39
+ };
40
+ if (deserialized.datacontenttype !== void 0) {
41
+ modelEvent.datacontenttype = deserialized.datacontenttype;
42
+ }
43
+ if (deserialized.dataschema !== void 0) {
44
+ modelEvent.dataschema = deserialized.dataschema;
45
+ }
46
+ if (deserialized.subject !== void 0) {
47
+ modelEvent.subject = deserialized.subject;
48
+ }
49
+ if (deserialized.time !== void 0) {
50
+ modelEvent.time = deserialized.time;
51
+ }
52
+ if (deserialized.data !== void 0) {
53
+ modelEvent.data = deserialized.data;
54
+ }
55
+ if (deserialized.dataBase64 !== void 0) {
56
+ if (deserialized.data !== void 0) {
57
+ throw new TypeError("event contains both a data and data_base64 field");
72
58
  }
73
- return events;
59
+ if (!(deserialized.dataBase64 instanceof Uint8Array)) {
60
+ throw new TypeError("event data_base64 property is not an instance of Uint8Array");
61
+ }
62
+ modelEvent.data = deserialized.dataBase64;
63
+ }
64
+ const extensionAttributes = { ...deserialized };
65
+ for (const propName of import_models.cloudEventReservedPropertyNames) {
66
+ delete extensionAttributes[propName];
67
+ }
68
+ delete extensionAttributes.dataBase64;
69
+ if (Object.keys(extensionAttributes).length > 0) {
70
+ modelEvent.extensionAttributes = extensionAttributes;
71
+ }
72
+ events.push(modelEvent);
74
73
  }
74
+ return events;
75
+ }
75
76
  }
76
- exports.EventGridDeserializer = EventGridDeserializer;
77
- //# sourceMappingURL=consumer.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"consumer.js","sourceRoot":"","sources":["../../src/consumer.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,oDAAsD;AAEtD,2CAA8D;AAC9D,uCAAkG;AAElG,MAAM,UAAU,GAAG,IAAA,8BAAgB,GAAE,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,MAAa,qBAAqB;IAiBzB,KAAK,CAAC,sBAAsB,CACjC,aAA+C;QAE/C,MAAM,Y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,MAAM,IAAI,SAAS,CAAC,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,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;YAChD,KAAK,MAAM,QAAQ,IAAI,2CAA+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;AAxFD,sDAwFC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createSerializer } from \"@azure/core-client\";\nimport type { CloudEvent } from \"./models.js\";\nimport { cloudEventReservedPropertyNames } from \"./models.js\";\nimport { CloudEvent as CloudEventMapper, parseAndWrap, validateCloudEventEvent } from \"./util.js\";\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
+ {
2
+ "version": 3,
3
+ "sources": ["/mnt/vss/_work/1/s/sdk/eventgrid/eventgrid-namespaces/src/consumer.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createSerializer } from \"@azure/core-client\";\nimport type { CloudEvent } from \"./models.js\";\nimport { cloudEventReservedPropertyNames } from \"./models.js\";\nimport { CloudEvent as CloudEventMapper, parseAndWrap, validateCloudEventEvent } from \"./util.js\";\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAAiC;AAEjC,oBAAgD;AAChD,kBAAsF;AAEtF,M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