@azure/storage-blob-changefeed 12.0.0-alpha.20250407.1 → 12.0.0-alpha.20250516.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 (467) hide show
  1. package/README.md +82 -37
  2. package/{types/latest/storage-blob-changefeed/src → dist/browser}/AvroReaderFactory.d.ts +2 -2
  3. package/dist/browser/AvroReaderFactory.d.ts.map +1 -0
  4. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/AvroReaderFactory.js +1 -1
  5. package/dist/browser/AvroReaderFactory.js.map +1 -0
  6. package/{types/latest/storage-blob-changefeed/src → dist/browser}/BlobChangeFeedClient.d.ts +74 -56
  7. package/dist/browser/BlobChangeFeedClient.d.ts.map +1 -0
  8. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/BlobChangeFeedClient.js +52 -44
  9. package/dist/browser/BlobChangeFeedClient.js.map +1 -0
  10. package/{types/latest/storage-blob-changefeed/src → dist/browser}/ChangeFeed.d.ts +4 -4
  11. package/dist/browser/ChangeFeed.d.ts.map +1 -0
  12. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/ChangeFeed.js +2 -2
  13. package/dist/browser/ChangeFeed.js.map +1 -0
  14. package/{types/latest/storage-blob-changefeed/src → dist/browser}/ChangeFeedFactory.d.ts +3 -3
  15. package/dist/browser/ChangeFeedFactory.d.ts.map +1 -0
  16. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/ChangeFeedFactory.js +14 -11
  17. package/dist/browser/ChangeFeedFactory.js.map +1 -0
  18. package/{types/latest/storage-blob-changefeed/src → dist/browser}/Chunk.d.ts +2 -3
  19. package/dist/browser/Chunk.d.ts.map +1 -0
  20. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/Chunk.js +1 -1
  21. package/dist/browser/Chunk.js.map +1 -0
  22. package/{types/latest/storage-blob-changefeed/src → dist/browser}/ChunkFactory.d.ts +3 -3
  23. package/dist/browser/ChunkFactory.d.ts.map +1 -0
  24. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/ChunkFactory.js +3 -3
  25. package/dist/browser/ChunkFactory.js.map +1 -0
  26. package/{types/latest/storage-blob-changefeed/src → dist/browser}/LazyLoadingBlobStream.d.ts +2 -2
  27. package/dist/browser/LazyLoadingBlobStream.d.ts.map +1 -0
  28. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/LazyLoadingBlobStream.js +2 -2
  29. package/dist/browser/LazyLoadingBlobStream.js.map +1 -0
  30. package/{types/latest/storage-blob-changefeed/src → dist/browser}/LazyLoadingBlobStreamFactory.d.ts +2 -2
  31. package/dist/browser/LazyLoadingBlobStreamFactory.d.ts.map +1 -0
  32. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/LazyLoadingBlobStreamFactory.js +1 -1
  33. package/dist/browser/LazyLoadingBlobStreamFactory.js.map +1 -0
  34. package/{types/latest/storage-blob-changefeed/src → dist/browser}/Segment.d.ts +3 -3
  35. package/dist/browser/Segment.d.ts.map +1 -0
  36. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/Segment.js +1 -1
  37. package/dist/browser/Segment.js.map +1 -0
  38. package/{types/latest/storage-blob-changefeed/src → dist/browser}/SegmentFactory.d.ts +3 -3
  39. package/dist/browser/SegmentFactory.d.ts.map +1 -0
  40. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/SegmentFactory.js +5 -5
  41. package/dist/browser/SegmentFactory.js.map +1 -0
  42. package/{types/latest/storage-blob-changefeed/src → dist/browser}/Shard.d.ts +4 -4
  43. package/dist/browser/Shard.d.ts.map +1 -0
  44. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/Shard.js +1 -1
  45. package/dist/browser/Shard.js.map +1 -0
  46. package/{types/latest/storage-blob-changefeed/src → dist/browser}/ShardFactory.d.ts +3 -3
  47. package/dist/browser/ShardFactory.d.ts.map +1 -0
  48. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/ShardFactory.js +2 -2
  49. package/dist/browser/ShardFactory.js.map +1 -0
  50. package/dist/browser/index.d.ts +4 -0
  51. package/dist/browser/index.d.ts.map +1 -0
  52. package/dist/browser/index.js +6 -0
  53. package/dist/browser/index.js.map +1 -0
  54. package/dist/browser/log.d.ts.map +1 -0
  55. package/dist/browser/log.js.map +1 -0
  56. package/dist/browser/models/BlobChangeFeedEvent.d.ts.map +1 -0
  57. package/dist/browser/models/BlobChangeFeedEvent.js.map +1 -0
  58. package/dist/browser/models/ChangeFeedCursor.d.ts.map +1 -0
  59. package/dist/browser/models/ChangeFeedCursor.js.map +1 -0
  60. package/dist/browser/models/models.d.ts.map +1 -0
  61. package/dist/browser/models/models.js.map +1 -0
  62. package/dist/browser/package.json +3 -0
  63. package/dist/browser/utils/constants.d.ts.map +1 -0
  64. package/dist/browser/utils/constants.js.map +1 -0
  65. package/dist/browser/utils/tracing.d.ts.map +1 -0
  66. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/utils/tracing.js +1 -1
  67. package/dist/browser/utils/tracing.js.map +1 -0
  68. package/dist/browser/utils/utils.browser.d.ts.map +1 -0
  69. package/dist/browser/utils/utils.browser.js.map +1 -0
  70. package/{types/latest/storage-blob-changefeed/src → dist/browser}/utils/utils.common.d.ts +1 -1
  71. package/dist/browser/utils/utils.common.d.ts.map +1 -0
  72. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/utils/utils.common.js +2 -2
  73. package/dist/browser/utils/utils.common.js.map +1 -0
  74. package/{types/latest/storage-blob-changefeed/src → dist/browser}/utils/utils.node.d.ts +1 -1
  75. package/dist/browser/utils/utils.node.d.ts.map +1 -0
  76. package/{dist-esm/storage-blob-changefeed/src → dist/browser}/utils/utils.node.js +1 -1
  77. package/dist/browser/utils/utils.node.js.map +1 -0
  78. package/dist/commonjs/AvroReaderFactory.d.ts +10 -0
  79. package/dist/commonjs/AvroReaderFactory.d.ts.map +1 -0
  80. package/dist/commonjs/AvroReaderFactory.js +21 -0
  81. package/dist/commonjs/AvroReaderFactory.js.map +1 -0
  82. package/dist/commonjs/BlobChangeFeedClient.d.ts +201 -0
  83. package/dist/commonjs/BlobChangeFeedClient.d.ts.map +1 -0
  84. package/dist/commonjs/BlobChangeFeedClient.js +239 -0
  85. package/dist/commonjs/BlobChangeFeedClient.js.map +1 -0
  86. package/dist/commonjs/ChangeFeed.d.ts +37 -0
  87. package/dist/commonjs/ChangeFeed.d.ts.map +1 -0
  88. package/dist/commonjs/ChangeFeed.js +97 -0
  89. package/dist/commonjs/ChangeFeed.js.map +1 -0
  90. package/dist/commonjs/ChangeFeedFactory.d.ts +13 -0
  91. package/dist/commonjs/ChangeFeedFactory.d.ts.map +1 -0
  92. package/dist/commonjs/ChangeFeedFactory.js +124 -0
  93. package/dist/commonjs/ChangeFeedFactory.js.map +1 -0
  94. package/dist/commonjs/Chunk.d.ts +27 -0
  95. package/dist/commonjs/Chunk.d.ts.map +1 -0
  96. package/dist/commonjs/Chunk.js +44 -0
  97. package/dist/commonjs/Chunk.js.map +1 -0
  98. package/dist/commonjs/ChunkFactory.d.ts +23 -0
  99. package/dist/commonjs/ChunkFactory.d.ts.map +1 -0
  100. package/dist/commonjs/ChunkFactory.js +34 -0
  101. package/dist/commonjs/ChunkFactory.js.map +1 -0
  102. package/dist/commonjs/LazyLoadingBlobStream.d.ts +46 -0
  103. package/dist/commonjs/LazyLoadingBlobStream.d.ts.map +1 -0
  104. package/dist/commonjs/LazyLoadingBlobStream.js +85 -0
  105. package/dist/commonjs/LazyLoadingBlobStream.js.map +1 -0
  106. package/dist/commonjs/LazyLoadingBlobStreamFactory.d.ts +7 -0
  107. package/dist/commonjs/LazyLoadingBlobStreamFactory.d.ts.map +1 -0
  108. package/dist/commonjs/LazyLoadingBlobStreamFactory.js +13 -0
  109. package/dist/commonjs/LazyLoadingBlobStreamFactory.js.map +1 -0
  110. package/dist/commonjs/Segment.d.ts +29 -0
  111. package/dist/commonjs/Segment.d.ts.map +1 -0
  112. package/dist/commonjs/Segment.js +64 -0
  113. package/dist/commonjs/Segment.js.map +1 -0
  114. package/dist/commonjs/SegmentFactory.d.ts +29 -0
  115. package/dist/commonjs/SegmentFactory.d.ts.map +1 -0
  116. package/dist/commonjs/SegmentFactory.js +50 -0
  117. package/dist/commonjs/SegmentFactory.js.map +1 -0
  118. package/dist/commonjs/Shard.d.ts +28 -0
  119. package/dist/commonjs/Shard.d.ts.map +1 -0
  120. package/dist/commonjs/Shard.js +45 -0
  121. package/dist/commonjs/Shard.js.map +1 -0
  122. package/dist/commonjs/ShardFactory.d.ts +21 -0
  123. package/dist/commonjs/ShardFactory.d.ts.map +1 -0
  124. package/dist/commonjs/ShardFactory.js +72 -0
  125. package/dist/commonjs/ShardFactory.js.map +1 -0
  126. package/dist/commonjs/index.d.ts +4 -0
  127. package/dist/commonjs/index.d.ts.map +1 -0
  128. package/dist/commonjs/index.js +9 -0
  129. package/dist/commonjs/index.js.map +1 -0
  130. package/dist/commonjs/log.d.ts +5 -0
  131. package/dist/commonjs/log.d.ts.map +1 -0
  132. package/dist/commonjs/log.js +11 -0
  133. package/dist/commonjs/log.js.map +1 -0
  134. package/dist/commonjs/models/BlobChangeFeedEvent.d.ts +233 -0
  135. package/dist/commonjs/models/BlobChangeFeedEvent.d.ts.map +1 -0
  136. package/dist/commonjs/models/BlobChangeFeedEvent.js +5 -0
  137. package/dist/commonjs/models/BlobChangeFeedEvent.js.map +1 -0
  138. package/dist/commonjs/models/ChangeFeedCursor.d.ts +17 -0
  139. package/dist/commonjs/models/ChangeFeedCursor.d.ts.map +1 -0
  140. package/dist/commonjs/models/ChangeFeedCursor.js +5 -0
  141. package/dist/commonjs/models/ChangeFeedCursor.js.map +1 -0
  142. package/dist/commonjs/models/models.d.ts +23 -0
  143. package/dist/commonjs/models/models.d.ts.map +1 -0
  144. package/dist/commonjs/models/models.js +5 -0
  145. package/dist/commonjs/models/models.js.map +1 -0
  146. package/dist/commonjs/package.json +3 -0
  147. package/{types/latest → dist/commonjs}/tsdoc-metadata.json +1 -1
  148. package/dist/commonjs/utils/constants.d.ts +9 -0
  149. package/dist/commonjs/utils/constants.d.ts.map +1 -0
  150. package/dist/commonjs/utils/constants.js +14 -0
  151. package/dist/commonjs/utils/constants.js.map +1 -0
  152. package/dist/commonjs/utils/tracing.d.ts +6 -0
  153. package/dist/commonjs/utils/tracing.d.ts.map +1 -0
  154. package/dist/commonjs/utils/tracing.js +17 -0
  155. package/dist/commonjs/utils/tracing.js.map +1 -0
  156. package/dist/commonjs/utils/utils.browser.d.ts +14 -0
  157. package/dist/commonjs/utils/utils.browser.d.ts.map +1 -0
  158. package/dist/commonjs/utils/utils.browser.js +34 -0
  159. package/dist/commonjs/utils/utils.browser.js.map +1 -0
  160. package/dist/commonjs/utils/utils.common.d.ts +37 -0
  161. package/dist/commonjs/utils/utils.common.d.ts.map +1 -0
  162. package/dist/commonjs/utils/utils.common.js +207 -0
  163. package/dist/commonjs/utils/utils.common.js.map +1 -0
  164. package/dist/commonjs/utils/utils.node.d.ts +14 -0
  165. package/dist/commonjs/utils/utils.node.d.ts.map +1 -0
  166. package/dist/commonjs/utils/utils.node.js +32 -0
  167. package/dist/commonjs/utils/utils.node.js.map +1 -0
  168. package/dist/esm/AvroReaderFactory.d.ts +10 -0
  169. package/dist/esm/AvroReaderFactory.d.ts.map +1 -0
  170. package/dist/esm/AvroReaderFactory.js +17 -0
  171. package/dist/esm/AvroReaderFactory.js.map +1 -0
  172. package/dist/esm/BlobChangeFeedClient.d.ts +201 -0
  173. package/dist/esm/BlobChangeFeedClient.d.ts.map +1 -0
  174. package/dist/esm/BlobChangeFeedClient.js +233 -0
  175. package/dist/esm/BlobChangeFeedClient.js.map +1 -0
  176. package/dist/esm/ChangeFeed.d.ts +37 -0
  177. package/dist/esm/ChangeFeed.d.ts.map +1 -0
  178. package/dist/esm/ChangeFeed.js +93 -0
  179. package/dist/esm/ChangeFeed.js.map +1 -0
  180. package/dist/esm/ChangeFeedFactory.d.ts +13 -0
  181. package/dist/esm/ChangeFeedFactory.d.ts.map +1 -0
  182. package/dist/esm/ChangeFeedFactory.js +120 -0
  183. package/dist/esm/ChangeFeedFactory.js.map +1 -0
  184. package/dist/esm/Chunk.d.ts +27 -0
  185. package/dist/esm/Chunk.d.ts.map +1 -0
  186. package/dist/esm/Chunk.js +40 -0
  187. package/dist/esm/Chunk.js.map +1 -0
  188. package/dist/esm/ChunkFactory.d.ts +23 -0
  189. package/dist/esm/ChunkFactory.d.ts.map +1 -0
  190. package/dist/esm/ChunkFactory.js +30 -0
  191. package/dist/esm/ChunkFactory.js.map +1 -0
  192. package/dist/esm/LazyLoadingBlobStream.d.ts +46 -0
  193. package/dist/esm/LazyLoadingBlobStream.d.ts.map +1 -0
  194. package/dist/esm/LazyLoadingBlobStream.js +81 -0
  195. package/dist/esm/LazyLoadingBlobStream.js.map +1 -0
  196. package/dist/esm/LazyLoadingBlobStreamFactory.d.ts +7 -0
  197. package/dist/esm/LazyLoadingBlobStreamFactory.d.ts.map +1 -0
  198. package/dist/esm/LazyLoadingBlobStreamFactory.js +9 -0
  199. package/dist/esm/LazyLoadingBlobStreamFactory.js.map +1 -0
  200. package/dist/esm/Segment.d.ts +29 -0
  201. package/dist/esm/Segment.d.ts.map +1 -0
  202. package/dist/esm/Segment.js +60 -0
  203. package/dist/esm/Segment.js.map +1 -0
  204. package/dist/esm/SegmentFactory.d.ts +29 -0
  205. package/dist/esm/SegmentFactory.d.ts.map +1 -0
  206. package/dist/esm/SegmentFactory.js +46 -0
  207. package/dist/esm/SegmentFactory.js.map +1 -0
  208. package/dist/esm/Shard.d.ts +28 -0
  209. package/dist/esm/Shard.d.ts.map +1 -0
  210. package/dist/esm/Shard.js +41 -0
  211. package/dist/esm/Shard.js.map +1 -0
  212. package/dist/esm/ShardFactory.d.ts +21 -0
  213. package/dist/esm/ShardFactory.d.ts.map +1 -0
  214. package/dist/esm/ShardFactory.js +68 -0
  215. package/dist/esm/ShardFactory.js.map +1 -0
  216. package/dist/esm/index.d.ts +4 -0
  217. package/dist/esm/index.d.ts.map +1 -0
  218. package/dist/esm/index.js +6 -0
  219. package/dist/esm/index.js.map +1 -0
  220. package/dist/esm/log.d.ts +5 -0
  221. package/dist/esm/log.d.ts.map +1 -0
  222. package/dist/esm/log.js +8 -0
  223. package/dist/esm/log.js.map +1 -0
  224. package/dist/esm/models/BlobChangeFeedEvent.d.ts +233 -0
  225. package/dist/esm/models/BlobChangeFeedEvent.d.ts.map +1 -0
  226. package/{dist-esm/storage-internal-avro/src/AvroReadable.js → dist/esm/models/BlobChangeFeedEvent.js} +2 -3
  227. package/dist/esm/models/BlobChangeFeedEvent.js.map +1 -0
  228. package/dist/esm/models/ChangeFeedCursor.d.ts +17 -0
  229. package/dist/esm/models/ChangeFeedCursor.d.ts.map +1 -0
  230. package/dist/esm/models/ChangeFeedCursor.js +4 -0
  231. package/dist/esm/models/ChangeFeedCursor.js.map +1 -0
  232. package/dist/esm/models/models.d.ts +23 -0
  233. package/dist/esm/models/models.d.ts.map +1 -0
  234. package/dist/esm/models/models.js +4 -0
  235. package/dist/esm/models/models.js.map +1 -0
  236. package/dist/esm/package.json +3 -0
  237. package/dist/esm/utils/constants.d.ts +9 -0
  238. package/dist/esm/utils/constants.d.ts.map +1 -0
  239. package/dist/esm/utils/constants.js +11 -0
  240. package/dist/esm/utils/constants.js.map +1 -0
  241. package/dist/esm/utils/tracing.d.ts +6 -0
  242. package/dist/esm/utils/tracing.d.ts.map +1 -0
  243. package/dist/esm/utils/tracing.js +14 -0
  244. package/dist/esm/utils/tracing.js.map +1 -0
  245. package/dist/esm/utils/utils.browser.d.ts +14 -0
  246. package/dist/esm/utils/utils.browser.d.ts.map +1 -0
  247. package/dist/esm/utils/utils.browser.js +29 -0
  248. package/dist/esm/utils/utils.browser.js.map +1 -0
  249. package/dist/esm/utils/utils.common.d.ts +37 -0
  250. package/dist/esm/utils/utils.common.d.ts.map +1 -0
  251. package/dist/esm/utils/utils.common.js +197 -0
  252. package/dist/esm/utils/utils.common.js.map +1 -0
  253. package/dist/esm/utils/utils.node.d.ts +14 -0
  254. package/dist/esm/utils/utils.node.d.ts.map +1 -0
  255. package/dist/esm/utils/utils.node.js +28 -0
  256. package/dist/esm/utils/utils.node.js.map +1 -0
  257. package/dist/react-native/AvroReaderFactory.d.ts +10 -0
  258. package/dist/react-native/AvroReaderFactory.d.ts.map +1 -0
  259. package/dist/react-native/AvroReaderFactory.js +17 -0
  260. package/dist/react-native/AvroReaderFactory.js.map +1 -0
  261. package/dist/react-native/BlobChangeFeedClient.d.ts +201 -0
  262. package/dist/react-native/BlobChangeFeedClient.d.ts.map +1 -0
  263. package/dist/react-native/BlobChangeFeedClient.js +233 -0
  264. package/dist/react-native/BlobChangeFeedClient.js.map +1 -0
  265. package/dist/react-native/ChangeFeed.d.ts +37 -0
  266. package/dist/react-native/ChangeFeed.d.ts.map +1 -0
  267. package/dist/react-native/ChangeFeed.js +93 -0
  268. package/dist/react-native/ChangeFeed.js.map +1 -0
  269. package/dist/react-native/ChangeFeedFactory.d.ts +13 -0
  270. package/dist/react-native/ChangeFeedFactory.d.ts.map +1 -0
  271. package/dist/react-native/ChangeFeedFactory.js +120 -0
  272. package/dist/react-native/ChangeFeedFactory.js.map +1 -0
  273. package/dist/react-native/Chunk.d.ts +27 -0
  274. package/dist/react-native/Chunk.d.ts.map +1 -0
  275. package/dist/react-native/Chunk.js +40 -0
  276. package/dist/react-native/Chunk.js.map +1 -0
  277. package/dist/react-native/ChunkFactory.d.ts +23 -0
  278. package/dist/react-native/ChunkFactory.d.ts.map +1 -0
  279. package/dist/react-native/ChunkFactory.js +30 -0
  280. package/dist/react-native/ChunkFactory.js.map +1 -0
  281. package/dist/react-native/LazyLoadingBlobStream.d.ts +46 -0
  282. package/dist/react-native/LazyLoadingBlobStream.d.ts.map +1 -0
  283. package/dist/react-native/LazyLoadingBlobStream.js +81 -0
  284. package/dist/react-native/LazyLoadingBlobStream.js.map +1 -0
  285. package/dist/react-native/LazyLoadingBlobStreamFactory.d.ts +7 -0
  286. package/dist/react-native/LazyLoadingBlobStreamFactory.d.ts.map +1 -0
  287. package/dist/react-native/LazyLoadingBlobStreamFactory.js +9 -0
  288. package/dist/react-native/LazyLoadingBlobStreamFactory.js.map +1 -0
  289. package/dist/react-native/Segment.d.ts +29 -0
  290. package/dist/react-native/Segment.d.ts.map +1 -0
  291. package/dist/react-native/Segment.js +60 -0
  292. package/dist/react-native/Segment.js.map +1 -0
  293. package/dist/react-native/SegmentFactory.d.ts +29 -0
  294. package/dist/react-native/SegmentFactory.d.ts.map +1 -0
  295. package/dist/react-native/SegmentFactory.js +46 -0
  296. package/dist/react-native/SegmentFactory.js.map +1 -0
  297. package/dist/react-native/Shard.d.ts +28 -0
  298. package/dist/react-native/Shard.d.ts.map +1 -0
  299. package/dist/react-native/Shard.js +41 -0
  300. package/dist/react-native/Shard.js.map +1 -0
  301. package/dist/react-native/ShardFactory.d.ts +21 -0
  302. package/dist/react-native/ShardFactory.d.ts.map +1 -0
  303. package/dist/react-native/ShardFactory.js +68 -0
  304. package/dist/react-native/ShardFactory.js.map +1 -0
  305. package/dist/react-native/index.d.ts +4 -0
  306. package/dist/react-native/index.d.ts.map +1 -0
  307. package/dist/react-native/index.js +6 -0
  308. package/dist/react-native/index.js.map +1 -0
  309. package/dist/react-native/log.d.ts +5 -0
  310. package/dist/react-native/log.d.ts.map +1 -0
  311. package/dist/react-native/log.js +8 -0
  312. package/dist/react-native/log.js.map +1 -0
  313. package/dist/react-native/models/BlobChangeFeedEvent.d.ts +233 -0
  314. package/dist/react-native/models/BlobChangeFeedEvent.d.ts.map +1 -0
  315. package/dist/react-native/models/BlobChangeFeedEvent.js +4 -0
  316. package/dist/react-native/models/BlobChangeFeedEvent.js.map +1 -0
  317. package/dist/react-native/models/ChangeFeedCursor.d.ts +17 -0
  318. package/dist/react-native/models/ChangeFeedCursor.d.ts.map +1 -0
  319. package/dist/react-native/models/ChangeFeedCursor.js +4 -0
  320. package/dist/react-native/models/ChangeFeedCursor.js.map +1 -0
  321. package/dist/react-native/models/models.d.ts +23 -0
  322. package/dist/react-native/models/models.d.ts.map +1 -0
  323. package/dist/react-native/models/models.js +4 -0
  324. package/dist/react-native/models/models.js.map +1 -0
  325. package/dist/react-native/package.json +3 -0
  326. package/dist/react-native/utils/constants.d.ts +9 -0
  327. package/dist/react-native/utils/constants.d.ts.map +1 -0
  328. package/dist/react-native/utils/constants.js +11 -0
  329. package/dist/react-native/utils/constants.js.map +1 -0
  330. package/dist/react-native/utils/tracing.d.ts +6 -0
  331. package/dist/react-native/utils/tracing.d.ts.map +1 -0
  332. package/dist/react-native/utils/tracing.js +14 -0
  333. package/dist/react-native/utils/tracing.js.map +1 -0
  334. package/dist/react-native/utils/utils.browser.d.ts +14 -0
  335. package/dist/react-native/utils/utils.browser.d.ts.map +1 -0
  336. package/dist/react-native/utils/utils.browser.js +29 -0
  337. package/dist/react-native/utils/utils.browser.js.map +1 -0
  338. package/dist/react-native/utils/utils.common.d.ts +37 -0
  339. package/dist/react-native/utils/utils.common.d.ts.map +1 -0
  340. package/dist/react-native/utils/utils.common.js +197 -0
  341. package/dist/react-native/utils/utils.common.js.map +1 -0
  342. package/dist/react-native/utils/utils.node.d.ts +14 -0
  343. package/dist/react-native/utils/utils.node.d.ts.map +1 -0
  344. package/dist/react-native/utils/utils.node.js +28 -0
  345. package/dist/react-native/utils/utils.node.js.map +1 -0
  346. package/package.json +69 -68
  347. package/dist/index.js +0 -1577
  348. package/dist/index.js.map +0 -1
  349. package/dist-esm/storage-blob-changefeed/src/AvroReaderFactory.js.map +0 -1
  350. package/dist-esm/storage-blob-changefeed/src/BlobChangeFeedClient.js.map +0 -1
  351. package/dist-esm/storage-blob-changefeed/src/ChangeFeed.js.map +0 -1
  352. package/dist-esm/storage-blob-changefeed/src/ChangeFeedFactory.js.map +0 -1
  353. package/dist-esm/storage-blob-changefeed/src/Chunk.js.map +0 -1
  354. package/dist-esm/storage-blob-changefeed/src/ChunkFactory.js.map +0 -1
  355. package/dist-esm/storage-blob-changefeed/src/LazyLoadingBlobStream.js.map +0 -1
  356. package/dist-esm/storage-blob-changefeed/src/LazyLoadingBlobStreamFactory.js.map +0 -1
  357. package/dist-esm/storage-blob-changefeed/src/Segment.js.map +0 -1
  358. package/dist-esm/storage-blob-changefeed/src/SegmentFactory.js.map +0 -1
  359. package/dist-esm/storage-blob-changefeed/src/Shard.js.map +0 -1
  360. package/dist-esm/storage-blob-changefeed/src/ShardFactory.js.map +0 -1
  361. package/dist-esm/storage-blob-changefeed/src/index.js +0 -6
  362. package/dist-esm/storage-blob-changefeed/src/index.js.map +0 -1
  363. package/dist-esm/storage-blob-changefeed/src/log.js.map +0 -1
  364. package/dist-esm/storage-blob-changefeed/src/models/BlobChangeFeedEvent.js.map +0 -1
  365. package/dist-esm/storage-blob-changefeed/src/models/ChangeFeedCursor.js.map +0 -1
  366. package/dist-esm/storage-blob-changefeed/src/models/models.js.map +0 -1
  367. package/dist-esm/storage-blob-changefeed/src/utils/constants.js.map +0 -1
  368. package/dist-esm/storage-blob-changefeed/src/utils/tracing.js.map +0 -1
  369. package/dist-esm/storage-blob-changefeed/src/utils/utils.browser.js.map +0 -1
  370. package/dist-esm/storage-blob-changefeed/src/utils/utils.common.js.map +0 -1
  371. package/dist-esm/storage-blob-changefeed/src/utils/utils.node.js.map +0 -1
  372. package/dist-esm/storage-internal-avro/src/AvroConstants.js +0 -7
  373. package/dist-esm/storage-internal-avro/src/AvroConstants.js.map +0 -1
  374. package/dist-esm/storage-internal-avro/src/AvroParser.js +0 -317
  375. package/dist-esm/storage-internal-avro/src/AvroParser.js.map +0 -1
  376. package/dist-esm/storage-internal-avro/src/AvroReadable.js.map +0 -1
  377. package/dist-esm/storage-internal-avro/src/AvroReadableFromBlob.js +0 -47
  378. package/dist-esm/storage-internal-avro/src/AvroReadableFromBlob.js.map +0 -1
  379. package/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js +0 -84
  380. package/dist-esm/storage-internal-avro/src/AvroReadableFromStream.js.map +0 -1
  381. package/dist-esm/storage-internal-avro/src/AvroReader.js +0 -106
  382. package/dist-esm/storage-internal-avro/src/AvroReader.js.map +0 -1
  383. package/dist-esm/storage-internal-avro/src/index.browser.js +0 -6
  384. package/dist-esm/storage-internal-avro/src/index.browser.js.map +0 -1
  385. package/dist-esm/storage-internal-avro/src/index.js +0 -6
  386. package/dist-esm/storage-internal-avro/src/index.js.map +0 -1
  387. package/dist-esm/storage-internal-avro/src/utils/utils.common.js +0 -16
  388. package/dist-esm/storage-internal-avro/src/utils/utils.common.js.map +0 -1
  389. package/types/latest/storage-blob-changefeed/samples-dev/blobChangeFeedClient.d.ts +0 -2
  390. package/types/latest/storage-blob-changefeed/samples-dev/blobChangeFeedClient.d.ts.map +0 -1
  391. package/types/latest/storage-blob-changefeed/samples-dev/resumeListChanges.d.ts +0 -2
  392. package/types/latest/storage-blob-changefeed/samples-dev/resumeListChanges.d.ts.map +0 -1
  393. package/types/latest/storage-blob-changefeed/src/AvroReaderFactory.d.ts.map +0 -1
  394. package/types/latest/storage-blob-changefeed/src/BlobChangeFeedClient.d.ts.map +0 -1
  395. package/types/latest/storage-blob-changefeed/src/ChangeFeed.d.ts.map +0 -1
  396. package/types/latest/storage-blob-changefeed/src/ChangeFeedFactory.d.ts.map +0 -1
  397. package/types/latest/storage-blob-changefeed/src/Chunk.d.ts.map +0 -1
  398. package/types/latest/storage-blob-changefeed/src/ChunkFactory.d.ts.map +0 -1
  399. package/types/latest/storage-blob-changefeed/src/LazyLoadingBlobStream.d.ts.map +0 -1
  400. package/types/latest/storage-blob-changefeed/src/LazyLoadingBlobStreamFactory.d.ts.map +0 -1
  401. package/types/latest/storage-blob-changefeed/src/Segment.d.ts.map +0 -1
  402. package/types/latest/storage-blob-changefeed/src/SegmentFactory.d.ts.map +0 -1
  403. package/types/latest/storage-blob-changefeed/src/Shard.d.ts.map +0 -1
  404. package/types/latest/storage-blob-changefeed/src/ShardFactory.d.ts.map +0 -1
  405. package/types/latest/storage-blob-changefeed/src/index.d.ts +0 -4
  406. package/types/latest/storage-blob-changefeed/src/index.d.ts.map +0 -1
  407. package/types/latest/storage-blob-changefeed/src/log.d.ts.map +0 -1
  408. package/types/latest/storage-blob-changefeed/src/models/BlobChangeFeedEvent.d.ts.map +0 -1
  409. package/types/latest/storage-blob-changefeed/src/models/ChangeFeedCursor.d.ts.map +0 -1
  410. package/types/latest/storage-blob-changefeed/src/models/models.d.ts.map +0 -1
  411. package/types/latest/storage-blob-changefeed/src/utils/constants.d.ts.map +0 -1
  412. package/types/latest/storage-blob-changefeed/src/utils/tracing.d.ts.map +0 -1
  413. package/types/latest/storage-blob-changefeed/src/utils/utils.browser.d.ts.map +0 -1
  414. package/types/latest/storage-blob-changefeed/src/utils/utils.common.d.ts.map +0 -1
  415. package/types/latest/storage-blob-changefeed/src/utils/utils.node.d.ts.map +0 -1
  416. package/types/latest/storage-blob-changefeed/test/blobchangefeedclient.spec.d.ts +0 -2
  417. package/types/latest/storage-blob-changefeed/test/blobchangefeedclient.spec.d.ts.map +0 -1
  418. package/types/latest/storage-blob-changefeed/test/changefeed.spec.d.ts +0 -2
  419. package/types/latest/storage-blob-changefeed/test/changefeed.spec.d.ts.map +0 -1
  420. package/types/latest/storage-blob-changefeed/test/chunk.spec.d.ts +0 -2
  421. package/types/latest/storage-blob-changefeed/test/chunk.spec.d.ts.map +0 -1
  422. package/types/latest/storage-blob-changefeed/test/segment.spec.d.ts +0 -2
  423. package/types/latest/storage-blob-changefeed/test/segment.spec.d.ts.map +0 -1
  424. package/types/latest/storage-blob-changefeed/test/shard.spec.d.ts +0 -2
  425. package/types/latest/storage-blob-changefeed/test/shard.spec.d.ts.map +0 -1
  426. package/types/latest/storage-blob-changefeed/test/utils/index.d.ts +0 -15
  427. package/types/latest/storage-blob-changefeed/test/utils/index.d.ts.map +0 -1
  428. package/types/latest/storage-blob-changefeed/test/utils/testutils.common.d.ts +0 -67
  429. package/types/latest/storage-blob-changefeed/test/utils/testutils.common.d.ts.map +0 -1
  430. package/types/latest/storage-blob-changefeed.d.ts +0 -453
  431. package/types/latest/storage-internal-avro/src/AvroConstants.d.ts +0 -5
  432. package/types/latest/storage-internal-avro/src/AvroConstants.d.ts.map +0 -1
  433. package/types/latest/storage-internal-avro/src/AvroParser.d.ts +0 -57
  434. package/types/latest/storage-internal-avro/src/AvroParser.d.ts.map +0 -1
  435. package/types/latest/storage-internal-avro/src/AvroReadable.d.ts +0 -16
  436. package/types/latest/storage-internal-avro/src/AvroReadable.d.ts.map +0 -1
  437. package/types/latest/storage-internal-avro/src/AvroReadableFromBlob.d.ts +0 -10
  438. package/types/latest/storage-internal-avro/src/AvroReadableFromBlob.d.ts.map +0 -1
  439. package/types/latest/storage-internal-avro/src/AvroReadableFromStream.d.ts +0 -11
  440. package/types/latest/storage-internal-avro/src/AvroReadableFromStream.d.ts.map +0 -1
  441. package/types/latest/storage-internal-avro/src/AvroReader.d.ts +0 -32
  442. package/types/latest/storage-internal-avro/src/AvroReader.d.ts.map +0 -1
  443. package/types/latest/storage-internal-avro/src/index.browser.d.ts +0 -4
  444. package/types/latest/storage-internal-avro/src/index.browser.d.ts.map +0 -1
  445. package/types/latest/storage-internal-avro/src/index.d.ts +0 -4
  446. package/types/latest/storage-internal-avro/src/index.d.ts.map +0 -1
  447. package/types/latest/storage-internal-avro/src/utils/utils.common.d.ts +0 -6
  448. package/types/latest/storage-internal-avro/src/utils/utils.common.d.ts.map +0 -1
  449. package/types/latest/storage-internal-avro/test/browser/avroreadable.spec.d.ts +0 -2
  450. package/types/latest/storage-internal-avro/test/browser/avroreadable.spec.d.ts.map +0 -1
  451. package/types/latest/storage-internal-avro/test/node/avroreadable.spec.d.ts +0 -2
  452. package/types/latest/storage-internal-avro/test/node/avroreadable.spec.d.ts.map +0 -1
  453. package/types/latest/storage-internal-avro/test/node/avroreader.spec.d.ts +0 -2
  454. package/types/latest/storage-internal-avro/test/node/avroreader.spec.d.ts.map +0 -1
  455. /package/{types/latest/storage-blob-changefeed/src → dist/browser}/log.d.ts +0 -0
  456. /package/{dist-esm/storage-blob-changefeed/src → dist/browser}/log.js +0 -0
  457. /package/{types/latest/storage-blob-changefeed/src → dist/browser}/models/BlobChangeFeedEvent.d.ts +0 -0
  458. /package/{dist-esm/storage-blob-changefeed/src → dist/browser}/models/BlobChangeFeedEvent.js +0 -0
  459. /package/{types/latest/storage-blob-changefeed/src → dist/browser}/models/ChangeFeedCursor.d.ts +0 -0
  460. /package/{dist-esm/storage-blob-changefeed/src → dist/browser}/models/ChangeFeedCursor.js +0 -0
  461. /package/{types/latest/storage-blob-changefeed/src → dist/browser}/models/models.d.ts +0 -0
  462. /package/{dist-esm/storage-blob-changefeed/src → dist/browser}/models/models.js +0 -0
  463. /package/{types/latest/storage-blob-changefeed/src → dist/browser}/utils/constants.d.ts +0 -0
  464. /package/{dist-esm/storage-blob-changefeed/src → dist/browser}/utils/constants.js +0 -0
  465. /package/{types/latest/storage-blob-changefeed/src → dist/browser}/utils/tracing.d.ts +0 -0
  466. /package/{types/latest/storage-blob-changefeed/src → dist/browser}/utils/utils.browser.d.ts +0 -0
  467. /package/{dist-esm/storage-blob-changefeed/src → dist/browser}/utils/utils.browser.js +0 -0
package/README.md CHANGED
@@ -67,9 +67,9 @@ This library offers a client you can use to fetch the change events.
67
67
 
68
68
  The `BlobChangeFeedClient` requires almost the same parameters as `BlobServiceClient` to initialize. Refer to [storage-blob](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob#create-the-blob-service-client) for how to create the blob service client. Here is an example using `StorageSharedKeyCredential`.
69
69
 
70
- ```javascript
71
- const { StorageSharedKeyCredential } = require("@azure/storage-blob");
72
- const { BlobChangeFeedClient } = require("@azure/storage-blob-changefeed");
70
+ ```ts snippet:ReadmeSampleCreateClient
71
+ import { StorageSharedKeyCredential } from "@azure/storage-blob";
72
+ import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
73
73
 
74
74
  // Enter your storage account name and shared key
75
75
  const account = "<account>";
@@ -88,45 +88,71 @@ const changeFeedClient = new BlobChangeFeedClient(
88
88
 
89
89
  Use `BlobChangeFeedClient.listChanges()` to get iterators to iterate through the change events.
90
90
 
91
- ```javascript
92
- const { BlobChangeFeedEvent } = require("@azure/storage-blob-changefeed");
91
+ ```ts snippet:ReadmeSampleListChanges
92
+ import { StorageSharedKeyCredential } from "@azure/storage-blob";
93
+ import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
93
94
 
94
- let changeFeedEvents = [];
95
+ const account = "<account>";
96
+ const accountKey = "<accountkey>";
97
+ const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
98
+ const changeFeedClient = new BlobChangeFeedClient(
99
+ `https://${account}.blob.core.windows.net`,
100
+ sharedKeyCredential,
101
+ );
102
+
103
+ // Use for await to iterate through the change feed
95
104
  for await (const event of changeFeedClient.listChanges()) {
96
- changeFeedEvents.push(event);
105
+ console.log(`Event: ${event.eventType}`);
106
+ console.log(`Event time: ${event.eventTime}`);
107
+ console.log(`Event data: ${JSON.stringify(event.data)}`);
97
108
  }
98
- ```
99
109
 
100
- By page.
101
-
102
- ```javascript
103
- const { BlobChangeFeedEvent } = require("@azure/storage-blob-changefeed");
104
-
105
- let changeFeedEvents = [];
106
- for await (const eventPage of changeFeedClient.listChanges().byPage()) {
107
- for (const event of eventPage.events) {
108
- changeFeedEvents.push(event);
110
+ // Use `byPage` to iterate through the change feed
111
+ for await (const page of changeFeedClient.listChanges().byPage()) {
112
+ console.log(`Page: ${JSON.stringify(page)}`);
113
+ for (const event of page.events) {
114
+ console.log(`Event: ${event.eventType}`);
115
+ console.log(`Event time: ${event.eventTime}`);
116
+ console.log(`Event data: ${JSON.stringify(event.data)}`);
109
117
  }
110
118
  }
111
119
  ```
112
120
 
113
121
  ### Resuming reading events with a continuationToken
114
122
 
115
- ```javascript
116
- const { BlobChangeFeedEvent } = require("@azure/storage-blob-changefeed");
123
+ ```ts snippet:ReadmeSampleListChanges_Continuation
124
+ import { StorageSharedKeyCredential } from "@azure/storage-blob";
125
+ import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
117
126
 
118
- let changeFeedEvents = [];
119
- const firstPage = await changeFeedClient.listChanges().byPage({ maxPageSize: 10 }).next();
120
- for (const event of firstPage.value.events) {
121
- changeFeedEvents.push(event);
122
- }
127
+ const account = "<account>";
128
+ const accountKey = "<accountkey>";
129
+ const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
130
+ const changeFeedClient = new BlobChangeFeedClient(
131
+ `https://${account}.blob.core.windows.net`,
132
+ sharedKeyCredential,
133
+ );
123
134
 
124
- // Resume iterating from the previous position with the continuationToken.
125
- for await (const eventPage of changeFeedClient
126
- .listChanges()
127
- .byPage({ continuationToken: firstPage.value.continuationToken })) {
128
- for (const event of eventPage.events) {
129
- changeFeedEvents.push(event);
135
+ let iterator = changeFeedClient.listChanges().byPage({ maxPageSize: 2 });
136
+ let response = (await iterator.next()).value;
137
+ // Prints 2 page ranges
138
+ if (response.pageRange) {
139
+ for (const pageRange of response.pageRange) {
140
+ console.log(`Event: ${pageRange.eventType}`);
141
+ console.log(`Event time: ${pageRange.eventTime}`);
142
+ console.log(`Event data: ${JSON.stringify(pageRange.data)}`);
143
+ }
144
+ }
145
+ // Gets next marker
146
+ let marker = response.continuationToken;
147
+ // Passing next marker as continuationToken
148
+ iterator = changeFeedClient.listChanges().byPage({ continuationToken: marker, maxPageSize: 10 });
149
+ response = (await iterator.next()).value;
150
+ // Prints 10 page ranges
151
+ if (response.pageRange) {
152
+ for (const pageRange of response.pageRange) {
153
+ console.log(`Event: ${pageRange.eventType}`);
154
+ console.log(`Event time: ${pageRange.eventTime}`);
155
+ console.log(`Event data: ${JSON.stringify(pageRange.data)}`);
130
156
  }
131
157
  }
132
158
  ```
@@ -137,16 +163,35 @@ Pass start time and end time to `BlobChangeFeedClient.listChanges()` to fetch ev
137
163
 
138
164
  Note that for now, the change feed client will round start time down to the nearest hour, and round end time up to the next hour.
139
165
 
140
- ```javascript
141
- const { BlobChangeFeedEvent } = require("@azure/storage-blob-changefeed");
166
+ ```ts snippet:ReadmeSampleListChangesTimeRange
167
+ import { StorageSharedKeyCredential } from "@azure/storage-blob";
168
+ import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
169
+
170
+ const account = "<account>";
171
+ const accountKey = "<accountkey>";
172
+ const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
173
+ const changeFeedClient = new BlobChangeFeedClient(
174
+ `https://${account}.blob.core.windows.net`,
175
+ sharedKeyCredential,
176
+ );
142
177
 
143
178
  const start = new Date(Date.UTC(2020, 1, 21, 22, 30, 0)); // will be rounded down to 22:00
144
179
  const end = new Date(Date.UTC(2020, 4, 8, 21, 10, 0)); // will be rounded up to 22:00
145
-
146
- let changeFeedEvents = [];
147
- // You can also provide just a start or end time.
180
+ // Use for await to iterate through the change feed
148
181
  for await (const event of changeFeedClient.listChanges({ start, end })) {
149
- changeFeedEvents.push(event);
182
+ console.log(`Event: ${event.eventType}`);
183
+ console.log(`Event time: ${event.eventTime}`);
184
+ console.log(`Event data: ${JSON.stringify(event.data)}`);
185
+ }
186
+
187
+ // Use `byPage` to iterate through the change feed
188
+ for await (const page of changeFeedClient.listChanges({ start, end }).byPage()) {
189
+ console.log(`Page: ${JSON.stringify(page)}`);
190
+ for (const event of page.events) {
191
+ console.log(`Event: ${event.eventType}`);
192
+ console.log(`Event time: ${event.eventTime}`);
193
+ console.log(`Event data: ${JSON.stringify(event.data)}`);
194
+ }
150
195
  }
151
196
  ```
152
197
 
@@ -154,7 +199,7 @@ for await (const event of changeFeedClient.listChanges({ start, end })) {
154
199
 
155
200
  Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
156
201
 
157
- ```javascript
202
+ ```ts snippet:SetLogLevel
158
203
  import { setLogLevel } from "@azure/logger";
159
204
 
160
205
  setLogLevel("info");
@@ -1,5 +1,5 @@
1
- import type { AvroReadable } from "../../storage-internal-avro/src";
2
- import { AvroReader } from "../../storage-internal-avro/src";
1
+ import type { AvroReadable } from "@azure/storage-internal-avro";
2
+ import { AvroReader } from "@azure/storage-internal-avro";
3
3
  /**
4
4
  * Creates AvroReaders. Allows us to inject mock AvroReaders in the Chunk unit tests.
5
5
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvroReaderFactory.d.ts","sourceRoot":"","sources":["../../src/AvroReaderFactory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAiB;IACrB,MAAM,CAAC,mBAAmB,EAAE,YAAY,GAAG,UAAU;IAErD,MAAM,CACX,UAAU,EAAE,YAAY,EACxB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,UAAU;CAcd"}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { AvroReader } from "../../storage-internal-avro/src";
3
+ import { AvroReader } from "@azure/storage-internal-avro";
4
4
  /**
5
5
  * Creates AvroReaders. Allows us to inject mock AvroReaders in the Chunk unit tests.
6
6
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvroReaderFactory.js","sourceRoot":"","sources":["../../src/AvroReaderFactory.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAUrB,MAAM,CACX,UAAwB,EACxB,YAA2B,EAC3B,WAAoB,EACpB,UAAmB;QAEnB,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,IAAI,UAAU,CAAC,UAAU,EAAE,YAAY,EAAE,WAAY,EAAE,UAAW,CAAC,CAAC;QAC7E,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AvroReadable } from \"@azure/storage-internal-avro\";\nimport { AvroReader } from \"@azure/storage-internal-avro\";\n\n/**\n * Creates AvroReaders. Allows us to inject mock AvroReaders in the Chunk unit tests.\n */\nexport class AvroReaderFactory {\n public create(headerAndDataStream: AvroReadable): AvroReader;\n\n public create(\n dataStream: AvroReadable,\n headerStream: AvroReadable,\n blockOffset: number,\n eventIndex: number,\n ): AvroReader;\n\n public create(\n dataStream: AvroReadable,\n headerStream?: AvroReadable,\n blockOffset?: number,\n eventIndex?: number,\n ): AvroReader {\n if (headerStream) {\n return new AvroReader(dataStream, headerStream, blockOffset!, eventIndex!);\n } else {\n return new AvroReader(dataStream);\n }\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import type { StoragePipelineOptions, StorageSharedKeyCredential, AnonymousCredential } from "@azure/storage-blob";
2
2
  import { Pipeline } from "@azure/storage-blob";
3
3
  import type { PagedAsyncIterableIterator } from "@azure/core-paging";
4
- import type { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
5
- import type { BlobChangeFeedListChangesOptions } from "./models/models";
4
+ import type { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent.js";
5
+ import type { BlobChangeFeedListChangesOptions } from "./models/models.js";
6
6
  import type { TokenCredential } from "@azure/core-auth";
7
7
  /**
8
8
  * Contains paged response data for the {@link BlobChangeFeedClient.listChanges} operation.
@@ -70,26 +70,36 @@ export declare class BlobChangeFeedClient {
70
70
  *
71
71
  * Example using DefaultAzureCredential from `@azure/identity`:
72
72
  *
73
- * ```js
74
- * const account = "<storage account name>";
73
+ * ```ts snippet:ReadmeSampleCreateClient_TokenCredential
74
+ * import { DefaultAzureCredential } from "@azure/identity";
75
+ * import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
75
76
  *
76
- * const defaultAzureCredential = new DefaultAzureCredential();
77
- *
78
- * const blobChangeFeedClient = new BlobChangeFeedClient(
77
+ * // Enter your storage account name and shared key
78
+ * const account = "<account>";
79
+ * const credential = new DefaultAzureCredential();
80
+ * const changeFeedClient = new BlobChangeFeedClient(
81
+ * // When using AnonymousCredential, following url should include a valid SAS or support public access
79
82
  * `https://${account}.blob.core.windows.net`,
80
- * defaultAzureCredential
83
+ * credential,
81
84
  * );
82
85
  * ```
83
86
  *
84
87
  * Example using an account name/key:
85
88
  *
86
- * ```js
87
- * const account = "<storage account name>"
88
- * const sharedKeyCredential = new StorageSharedKeyCredential(account, "<account key>");
89
- *
90
- * const blobChangeFeedClient = new BlobChangeFeedClient(
89
+ * ```ts snippet:ReadmeSampleCreateClient
90
+ * import { StorageSharedKeyCredential } from "@azure/storage-blob";
91
+ * import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
92
+ *
93
+ * // Enter your storage account name and shared key
94
+ * const account = "<account>";
95
+ * const accountKey = "<accountkey>";
96
+ * // Use StorageSharedKeyCredential with storage account and account key
97
+ * // StorageSharedKeyCredential is only available in Node.js runtime, not in browsers
98
+ * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
99
+ * const changeFeedClient = new BlobChangeFeedClient(
100
+ * // When using AnonymousCredential, following url should include a valid SAS or support public access
91
101
  * `https://${account}.blob.core.windows.net`,
92
- * sharedKeyCredential
102
+ * sharedKeyCredential,
93
103
  * );
94
104
  * ```
95
105
  */
@@ -114,63 +124,71 @@ export declare class BlobChangeFeedClient {
114
124
  *
115
125
  * Example using `for await` syntax:
116
126
  *
117
- * ```js
118
- * let i = 1;
119
- * for await (const event of blobChangeFeedClient.listChanges()) {
120
- * console.log(`Event ${i++}, type: ${event.eventType}`);
121
- * }
122
- * ```
127
+ * ```ts snippet:ReadmeSampleListChanges
128
+ * import { StorageSharedKeyCredential } from "@azure/storage-blob";
129
+ * import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
123
130
  *
124
- * Example using `iter.next()`:
131
+ * const account = "<account>";
132
+ * const accountKey = "<accountkey>";
133
+ * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
134
+ * const changeFeedClient = new BlobChangeFeedClient(
135
+ * `https://${account}.blob.core.windows.net`,
136
+ * sharedKeyCredential,
137
+ * );
125
138
  *
126
- * ```js
127
- * let i = 1;
128
- * const iter = blobChangeFeedClient.listChanges();
129
- * let eventItem = await iter.next();
130
- * while (!eventItem.done) {
131
- * console.log(`Event ${i++}, type: ${eventItem.eventType}`);
132
- * eventItem = await iter.next();
139
+ * // Use for await to iterate through the change feed
140
+ * for await (const event of changeFeedClient.listChanges()) {
141
+ * console.log(`Event: ${event.eventType}`);
142
+ * console.log(`Event time: ${event.eventTime}`);
143
+ * console.log(`Event data: ${JSON.stringify(event.data)}`);
133
144
  * }
134
- * ```
135
- *
136
- * Example using `byPage()`:
137
145
  *
138
- * ```js
139
- * // passing optional maxPageSize in the page settings
140
- * let i = 1;
141
- * for await (const eventPage of blobChangeFeedClient.listChanges().byPage({ maxPageSize: 20 })) {
142
- * if (eventPage.events) {
143
- * for (const event of eventPage.events) {
144
- * console.log(`Event ${i++}, type: ${event.eventType}`);
145
- * }
146
+ * // Use `byPage` to iterate through the change feed
147
+ * for await (const page of changeFeedClient.listChanges().byPage()) {
148
+ * console.log(`Page: ${JSON.stringify(page)}`);
149
+ * for (const event of page.events) {
150
+ * console.log(`Event: ${event.eventType}`);
151
+ * console.log(`Event time: ${event.eventTime}`);
152
+ * console.log(`Event data: ${JSON.stringify(event.data)}`);
146
153
  * }
147
154
  * }
148
155
  * ```
149
156
  *
150
157
  * Example using paging with a marker:
151
158
  *
152
- * ```js
153
- * let i = 1;
154
- * let iterator = blobChangeFeedClient.listChanges().byPage({ maxPageSize: 2 });
155
- * let eventPage = (await iterator.next()).value;
159
+ * ```ts snippet:ReadmeSampleListChanges_Continuation
160
+ * import { StorageSharedKeyCredential } from "@azure/storage-blob";
161
+ * import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
162
+ *
163
+ * const account = "<account>";
164
+ * const accountKey = "<accountkey>";
165
+ * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
166
+ * const changeFeedClient = new BlobChangeFeedClient(
167
+ * `https://${account}.blob.core.windows.net`,
168
+ * sharedKeyCredential,
169
+ * );
156
170
  *
157
- * if (eventPage.events) {
158
- * for (const container of eventPage.events) {
159
- * console.log(`Event ${i++}, type: ${event.eventType}`);
171
+ * let iterator = changeFeedClient.listChanges().byPage({ maxPageSize: 2 });
172
+ * let response = (await iterator.next()).value;
173
+ * // Prints 2 page ranges
174
+ * if (response.pageRange) {
175
+ * for (const pageRange of response.pageRange) {
176
+ * console.log(`Event: ${pageRange.eventType}`);
177
+ * console.log(`Event time: ${pageRange.eventTime}`);
178
+ * console.log(`Event data: ${JSON.stringify(pageRange.data)}`);
160
179
  * }
161
180
  * }
162
- *
163
181
  * // Gets next marker
164
- * let marker = eventPage.continuationToken;
182
+ * let marker = response.continuationToken;
165
183
  * // Passing next marker as continuationToken
166
- * iterator = blobChangeFeedClient
167
- * .listChanges()
168
- * .byPage({ continuationToken: marker, maxPageSize: 10 });
169
- * eventPage = (await iterator.next()).value;
170
- *
171
- * if (eventPage.events) {
172
- * for (const container of eventPage.events) {
173
- * console.log(`Event ${i++}, type: ${event.eventType}`);
184
+ * iterator = changeFeedClient.listChanges().byPage({ continuationToken: marker, maxPageSize: 10 });
185
+ * response = (await iterator.next()).value;
186
+ * // Prints 10 page ranges
187
+ * if (response.pageRange) {
188
+ * for (const pageRange of response.pageRange) {
189
+ * console.log(`Event: ${pageRange.eventType}`);
190
+ * console.log(`Event time: ${pageRange.eventTime}`);
191
+ * console.log(`Event data: ${JSON.stringify(pageRange.data)}`);
174
192
  * }
175
193
  * }
176
194
  * ```
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlobChangeFeedClient.d.ts","sourceRoot":"","sources":["../../src/BlobChangeFeedClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,sBAAsB,EACtB,0BA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IAGvD;;;;;;;;OAQG;gBACS,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;YA6B5B,SAAS;YAuBT,OAAO;IAoCtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+EG;IACI,WAAW,CAChB,OAAO,GAAE,gCAAqC,GAC7C,0BAA0B,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;CAuB5E"}
@@ -2,8 +2,8 @@
2
2
  // Licensed under the MIT License.
3
3
  import { __asyncGenerator, __await } from "tslib";
4
4
  import { BlobServiceClient, Pipeline } from "@azure/storage-blob";
5
- import { ChangeFeedFactory } from "./ChangeFeedFactory";
6
- import { CHANGE_FEED_MAX_PAGE_SIZE, SDK_VERSION } from "./utils/constants";
5
+ import { ChangeFeedFactory } from "./ChangeFeedFactory.js";
6
+ import { CHANGE_FEED_MAX_PAGE_SIZE, SDK_VERSION } from "./utils/constants.js";
7
7
  /**
8
8
  * Contains paged response data for the {@link BlobChangeFeedClient.listChanges} operation.
9
9
  */
@@ -134,63 +134,71 @@ export class BlobChangeFeedClient {
134
134
  *
135
135
  * Example using `for await` syntax:
136
136
  *
137
- * ```js
138
- * let i = 1;
139
- * for await (const event of blobChangeFeedClient.listChanges()) {
140
- * console.log(`Event ${i++}, type: ${event.eventType}`);
141
- * }
142
- * ```
137
+ * ```ts snippet:ReadmeSampleListChanges
138
+ * import { StorageSharedKeyCredential } from "@azure/storage-blob";
139
+ * import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
143
140
  *
144
- * Example using `iter.next()`:
141
+ * const account = "<account>";
142
+ * const accountKey = "<accountkey>";
143
+ * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
144
+ * const changeFeedClient = new BlobChangeFeedClient(
145
+ * `https://${account}.blob.core.windows.net`,
146
+ * sharedKeyCredential,
147
+ * );
145
148
  *
146
- * ```js
147
- * let i = 1;
148
- * const iter = blobChangeFeedClient.listChanges();
149
- * let eventItem = await iter.next();
150
- * while (!eventItem.done) {
151
- * console.log(`Event ${i++}, type: ${eventItem.eventType}`);
152
- * eventItem = await iter.next();
149
+ * // Use for await to iterate through the change feed
150
+ * for await (const event of changeFeedClient.listChanges()) {
151
+ * console.log(`Event: ${event.eventType}`);
152
+ * console.log(`Event time: ${event.eventTime}`);
153
+ * console.log(`Event data: ${JSON.stringify(event.data)}`);
153
154
  * }
154
- * ```
155
- *
156
- * Example using `byPage()`:
157
155
  *
158
- * ```js
159
- * // passing optional maxPageSize in the page settings
160
- * let i = 1;
161
- * for await (const eventPage of blobChangeFeedClient.listChanges().byPage({ maxPageSize: 20 })) {
162
- * if (eventPage.events) {
163
- * for (const event of eventPage.events) {
164
- * console.log(`Event ${i++}, type: ${event.eventType}`);
165
- * }
156
+ * // Use `byPage` to iterate through the change feed
157
+ * for await (const page of changeFeedClient.listChanges().byPage()) {
158
+ * console.log(`Page: ${JSON.stringify(page)}`);
159
+ * for (const event of page.events) {
160
+ * console.log(`Event: ${event.eventType}`);
161
+ * console.log(`Event time: ${event.eventTime}`);
162
+ * console.log(`Event data: ${JSON.stringify(event.data)}`);
166
163
  * }
167
164
  * }
168
165
  * ```
169
166
  *
170
167
  * Example using paging with a marker:
171
168
  *
172
- * ```js
173
- * let i = 1;
174
- * let iterator = blobChangeFeedClient.listChanges().byPage({ maxPageSize: 2 });
175
- * let eventPage = (await iterator.next()).value;
169
+ * ```ts snippet:ReadmeSampleListChanges_Continuation
170
+ * import { StorageSharedKeyCredential } from "@azure/storage-blob";
171
+ * import { BlobChangeFeedClient } from "@azure/storage-blob-changefeed";
176
172
  *
177
- * if (eventPage.events) {
178
- * for (const container of eventPage.events) {
179
- * console.log(`Event ${i++}, type: ${event.eventType}`);
173
+ * const account = "<account>";
174
+ * const accountKey = "<accountkey>";
175
+ * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
176
+ * const changeFeedClient = new BlobChangeFeedClient(
177
+ * `https://${account}.blob.core.windows.net`,
178
+ * sharedKeyCredential,
179
+ * );
180
+ *
181
+ * let iterator = changeFeedClient.listChanges().byPage({ maxPageSize: 2 });
182
+ * let response = (await iterator.next()).value;
183
+ * // Prints 2 page ranges
184
+ * if (response.pageRange) {
185
+ * for (const pageRange of response.pageRange) {
186
+ * console.log(`Event: ${pageRange.eventType}`);
187
+ * console.log(`Event time: ${pageRange.eventTime}`);
188
+ * console.log(`Event data: ${JSON.stringify(pageRange.data)}`);
180
189
  * }
181
190
  * }
182
- *
183
191
  * // Gets next marker
184
- * let marker = eventPage.continuationToken;
192
+ * let marker = response.continuationToken;
185
193
  * // Passing next marker as continuationToken
186
- * iterator = blobChangeFeedClient
187
- * .listChanges()
188
- * .byPage({ continuationToken: marker, maxPageSize: 10 });
189
- * eventPage = (await iterator.next()).value;
190
- *
191
- * if (eventPage.events) {
192
- * for (const container of eventPage.events) {
193
- * console.log(`Event ${i++}, type: ${event.eventType}`);
194
+ * iterator = changeFeedClient.listChanges().byPage({ continuationToken: marker, maxPageSize: 10 });
195
+ * response = (await iterator.next()).value;
196
+ * // Prints 10 page ranges
197
+ * if (response.pageRange) {
198
+ * for (const pageRange of response.pageRange) {
199
+ * console.log(`Event: ${pageRange.eventType}`);
200
+ * console.log(`Event time: ${pageRange.eventTime}`);
201
+ * console.log(`Event data: ${JSON.stringify(pageRange.data)}`);
194
202
  * }
195
203
  * }
196
204
  * ```
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlobChangeFeedClient.js","sourceRoot":"","sources":["../../src/BlobChangeFeedClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAOlC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAI9E;;GAEG;AACH,MAAM,OAA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C,CAAC;QACrC,OAAO;YACL;;eAEG;YACH,KAAK,CAAC,IAAI;gBACR,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD;;eAEG;YACH,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD;;eAEG;YACH,MAAM,EAAE,CAAC,WAAyB,EAAE,EAAE,EAAE;gBACtC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YACjF,CAAC;SACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n StoragePipelineOptions,\n StorageSharedKeyCredential,\n AnonymousCredential,\n} from \"@azure/storage-blob\";\nimport { BlobServiceClient, Pipeline } from \"@azure/storage-blob\";\nimport type { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport type { BlobChangeFeedEvent } from \"./models/BlobChangeFeedEvent.js\";\nimport { ChangeFeedFactory } from \"./ChangeFeedFactory.js\";\nimport type { ChangeFeed } from \"./ChangeFeed.js\";\nimport { CHANGE_FEED_MAX_PAGE_SIZE, SDK_VERSION } from \"./utils/constants.js\";\nimport type { BlobChangeFeedListChangesOptions } from \"./models/models.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\n/**\n * Contains paged response data for the {@link BlobChangeFeedClient.listChanges} operation.\n */\nexport class BlobChangeFeedEventPage {\n /**\n * Array of {@link BlobChangeFeedEvent}.\n */\n public events: BlobChangeFeedEvent[];\n\n /**\n * The token that keeps track of where to continue the iterator.\n */\n public continuationToken: string;\n\n constructor() {\n this.events = [];\n this.continuationToken = \"\";\n }\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n return newPipeline(credential, appendUserAgentPrefix(pipelineOptions));\n}\n\nfunction appendUserAgentPrefix(options?: StoragePipelineOptions): StoragePipelineOptions {\n if (!options) {\n options = {};\n }\n if (options.userAgentOptions === undefined) {\n options.userAgentOptions = {};\n }\n\n if (options.userAgentOptions.userAgentPrefix === undefined) {\n options.userAgentOptions.userAgentPrefix = \"\";\n } else if (options.userAgentOptions.userAgentPrefix !== \"\") {\n options.userAgentOptions.userAgentPrefix += \" \";\n }\n options.userAgentOptions.userAgentPrefix += `changefeed-js/${SDK_VERSION}`;\n return options;\n}\n\n/**\n * Blob Change Feed client options.\n */\nexport interface BlobChangeFeedClientOptions {\n /**\n * The maximum length of an transfer in bytes.\n */\n maximumTransferSize?: number;\n}\n\n/**\n * BlobChangeFeedClient.\n * @see https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-change-feed?tabs=azure-portal\n */\nexport class BlobChangeFeedClient {\n /**\n * blobServiceClient provided by `@azure/storage-blob` package.\n */\n private blobServiceClient: BlobServiceClient;\n private changeFeedFactory: ChangeFeedFactory;\n private changeFeedClientOptions: BlobChangeFeedClientOptions;\n\n /**\n *\n * Creates an instance of BlobChangeFeedClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public static fromConnectionString(\n connectionString: string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n // Static method to construct an object, the option is for the object not for the method.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n changeFeedClientOptions?: BlobChangeFeedClientOptions,\n ): BlobChangeFeedClient {\n const blobServiceClient = BlobServiceClient.fromConnectionString(connectionString, options);\n return new BlobChangeFeedClient(\n blobServiceClient.url,\n blobServiceClient.credential,\n appendUserAgentPrefix(options),\n changeFeedClientOptions,\n );\n }\n\n /**\n * Creates an instance of BlobChangeFeedClient.\n *\n * @param url - A Client string pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n *\n * Example using DefaultAzureCredential from `@azure/identity`:\n *\n * ```ts snippet:ReadmeSampleCreateClient_TokenCredential\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { BlobChangeFeedClient } from \"@azure/storage-blob-changefeed\";\n *\n * // Enter your storage account name and shared key\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n * const changeFeedClient = new BlobChangeFeedClient(\n * // When using AnonymousCredential, following url should include a valid SAS or support public access\n * `https://${account}.blob.core.windows.net`,\n * credential,\n * );\n * ```\n *\n * Example using an account name/key:\n *\n * ```ts snippet:ReadmeSampleCreateClient\n * import { StorageSharedKeyCredential } from \"@azure/storage-blob\";\n * import { BlobChangeFeedClient } from \"@azure/storage-blob-changefeed\";\n *\n * // Enter your storage account name and shared key\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * // Use StorageSharedKeyCredential with storage account and account key\n * // StorageSharedKeyCredential is only available in Node.js runtime, not in browsers\n * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);\n * const changeFeedClient = new BlobChangeFeedClient(\n * // When using AnonymousCredential, following url should include a valid SAS or support public access\n * `https://${account}.blob.core.windows.net`,\n * sharedKeyCredential,\n * );\n * ```\n */\n constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n changeFeedClientOptions?: BlobChangeFeedClientOptions,\n );\n\n /**\n * Creates an instance of BlobChangeFeedClient.\n *\n * @param url - A Client string pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline);\n constructor(\n urlOrClient: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n changeFeedClientOptions?: BlobChangeFeedClientOptions,\n ) {\n this.changeFeedClientOptions = changeFeedClientOptions || {};\n this.changeFeedFactory = new ChangeFeedFactory(\n this.changeFeedClientOptions.maximumTransferSize,\n );\n\n if (credentialOrPipeline instanceof Pipeline) {\n this.blobServiceClient = new BlobServiceClient(urlOrClient, credentialOrPipeline);\n } else {\n this.blobServiceClient = new BlobServiceClient(\n urlOrClient,\n credentialOrPipeline,\n appendUserAgentPrefix(options),\n );\n }\n }\n\n private async *getChange(\n options: BlobChangeFeedListChangesOptions = {},\n ): AsyncIterableIterator<BlobChangeFeedEvent> {\n const changeFeed: ChangeFeed = await this.changeFeedFactory.create(\n this.blobServiceClient,\n undefined,\n options,\n );\n\n while (changeFeed.hasNext()) {\n const event = await changeFeed.getChange({\n abortSignal: options.abortSignal,\n tracingOptions: options.tracingOptions,\n });\n if (event) {\n yield event;\n } else {\n return;\n }\n }\n }\n\n // start in ChangeFeedListChangesOptions will be ignored when continuationToken is specified.\n private async *getPage(\n continuationToken?: string,\n maxPageSize?: number,\n options: BlobChangeFeedListChangesOptions = {},\n ): AsyncIterableIterator<BlobChangeFeedEventPage> {\n const changeFeed: ChangeFeed = await this.changeFeedFactory.create(\n this.blobServiceClient,\n continuationToken,\n options,\n );\n\n if (!maxPageSize || maxPageSize > CHANGE_FEED_MAX_PAGE_SIZE) {\n maxPageSize = CHANGE_FEED_MAX_PAGE_SIZE;\n }\n while (changeFeed.hasNext()) {\n const eventPage = new BlobChangeFeedEventPage();\n while (changeFeed.hasNext() && eventPage.events.length < maxPageSize) {\n const event = await changeFeed.getChange({\n abortSignal: options.abortSignal,\n tracingOptions: options.tracingOptions,\n });\n if (event) {\n eventPage.events.push(event);\n }\n }\n if (changeFeed.hasNext()) {\n eventPage.continuationToken = JSON.stringify(changeFeed.getCursor());\n }\n if (eventPage.events.length > 0) {\n yield eventPage;\n } else {\n return;\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the change feed events\n * in the specified account.\n *\n * .byPage() returns an async iterable iterator to list the change feed events in pages.\n *\n * Example using `for await` syntax:\n *\n * ```ts snippet:ReadmeSampleListChanges\n * import { StorageSharedKeyCredential } from \"@azure/storage-blob\";\n * import { BlobChangeFeedClient } from \"@azure/storage-blob-changefeed\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);\n * const changeFeedClient = new BlobChangeFeedClient(\n * `https://${account}.blob.core.windows.net`,\n * sharedKeyCredential,\n * );\n *\n * // Use for await to iterate through the change feed\n * for await (const event of changeFeedClient.listChanges()) {\n * console.log(`Event: ${event.eventType}`);\n * console.log(`Event time: ${event.eventTime}`);\n * console.log(`Event data: ${JSON.stringify(event.data)}`);\n * }\n *\n * // Use `byPage` to iterate through the change feed\n * for await (const page of changeFeedClient.listChanges().byPage()) {\n * console.log(`Page: ${JSON.stringify(page)}`);\n * for (const event of page.events) {\n * console.log(`Event: ${event.eventType}`);\n * console.log(`Event time: ${event.eventTime}`);\n * console.log(`Event data: ${JSON.stringify(event.data)}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```ts snippet:ReadmeSampleListChanges_Continuation\n * import { StorageSharedKeyCredential } from \"@azure/storage-blob\";\n * import { BlobChangeFeedClient } from \"@azure/storage-blob-changefeed\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);\n * const changeFeedClient = new BlobChangeFeedClient(\n * `https://${account}.blob.core.windows.net`,\n * sharedKeyCredential,\n * );\n *\n * let iterator = changeFeedClient.listChanges().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n * // Prints 2 page ranges\n * if (response.pageRange) {\n * for (const pageRange of response.pageRange) {\n * console.log(`Event: ${pageRange.eventType}`);\n * console.log(`Event time: ${pageRange.eventTime}`);\n * console.log(`Event data: ${JSON.stringify(pageRange.data)}`);\n * }\n * }\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * iterator = changeFeedClient.listChanges().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n * // Prints 10 page ranges\n * if (response.pageRange) {\n * for (const pageRange of response.pageRange) {\n * console.log(`Event: ${pageRange.eventType}`);\n * console.log(`Event time: ${pageRange.eventTime}`);\n * console.log(`Event data: ${JSON.stringify(pageRange.data)}`);\n * }\n * }\n * ```\n *\n * @param options - Options to list change feed events.\n * @returns An asyncIterableIterator that supports paging.\n */\n public listChanges(\n options: BlobChangeFeedListChangesOptions = {},\n ): PagedAsyncIterableIterator<BlobChangeFeedEvent, BlobChangeFeedEventPage> {\n const iter = this.getChange(options);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n async next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.getPage(settings.continuationToken, settings.maxPageSize, options);\n },\n };\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import type { ContainerClient, CommonOptions } from "@azure/storage-blob";
2
- import type { Segment } from "./Segment";
3
- import type { SegmentFactory } from "./SegmentFactory";
4
- import type { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
5
- import type { ChangeFeedCursor } from "./models/ChangeFeedCursor";
2
+ import type { Segment } from "./Segment.js";
3
+ import type { SegmentFactory } from "./SegmentFactory.js";
4
+ import type { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent.js";
5
+ import type { ChangeFeedCursor } from "./models/ChangeFeedCursor.js";
6
6
  import type { AbortSignalLike } from "@azure/abort-controller";
7
7
  /**
8
8
  * Options to configure {@link ChangeFeed.getChange} operation.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeFeed.d.ts","sourceRoot":"","sources":["../../src/ChangeFeed.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,qBAAa,UAAU;IACrB;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAkB;IAEnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAiB;IAEjD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAW;IAEjC,OAAO,CAAC,QAAQ,CAAW;IAE3B,OAAO,CAAC,cAAc,CAAC,CAAU;IAEjC,OAAO,CAAC,cAAc,CAAC,CAAO;IAE9B,OAAO,CAAC,SAAS,CAAC,CAAO;IAEzB,OAAO,CAAC,OAAO,CAAC,CAAO;IAEvB,OAAO,CAAC,GAAG,CAAC,CAAO;;gBAIjB,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,MAAM,EAAE,EACf,QAAQ,EAAE,MAAM,EAAE,EAClB,cAAc,EAAE,OAAO,EACvB,cAAc,EAAE,IAAI,EACpB,SAAS,CAAC,EAAE,IAAI,EAChB,OAAO,CAAC,EAAE,IAAI;YA0BF,yBAAyB;IA0DhC,OAAO,IAAI,OAAO;IAaZ,SAAS,CACpB,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAiBpC,SAAS,IAAI,gBAAgB;CAYrC"}
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { getSegmentsInYear, minDate, getHost } from "./utils/utils.common";
4
- import { tracingClient } from "./utils/tracing";
3
+ import { getSegmentsInYear, minDate, getHost } from "./utils/utils.common.js";
4
+ import { tracingClient } from "./utils/tracing.js";
5
5
  export class ChangeFeed {
6
6
  constructor(containerClient, segmentFactory, years, segments, currentSegment, lastConsumable, startTime, endTime) {
7
7
  this.containerClient = containerClient;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeFeed.js","sourceRoot":"","sources":["../../src/ChangeFeed.ts"],"names":[],"mappings":"AAAA,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AAe,CAAC,SAAS,EAAE;SACvD,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ContainerClient, CommonOptions } from \"@azure/storage-blob\";\nimport type { Segment } from \"./Segment.js\";\nimport type { SegmentFactory } from \"./SegmentFactory.js\";\nimport type { BlobChangeFeedEvent } from \"./models/BlobChangeFeedEvent.js\";\nimport type { ChangeFeedCursor } from \"./models/ChangeFeedCursor.js\";\nimport { getSegmentsInYear, minDate, getHost } from \"./utils/utils.common.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport { tracingClient } from \"./utils/tracing.js\";\n\n/**\n * Options to configure {@link ChangeFeed.getChange} operation.\n */\nexport interface ChangeFeedGetChangeOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\nexport class ChangeFeed {\n /**\n * BlobContainerClient for making List Blob requests and creating Segments.\n */\n private readonly containerClient?: ContainerClient;\n\n private readonly segmentFactory?: SegmentFactory;\n\n private readonly years: number[];\n\n private segments: string[];\n\n private currentSegment?: Segment;\n\n private lastConsumable?: Date;\n\n private startTime?: Date;\n\n private endTime?: Date;\n\n private end?: Date;\n\n constructor();\n constructor(\n containerClient: ContainerClient,\n segmentFactory: SegmentFactory,\n years: number[],\n segments: string[],\n currentSegment: Segment,\n lastConsumable: Date,\n startTime?: Date,\n endTime?: Date,\n );\n\n constructor(\n containerClient?: ContainerClient,\n segmentFactory?: SegmentFactory,\n years?: number[],\n segments?: string[],\n currentSegment?: Segment,\n lastConsumable?: Date,\n startTime?: Date,\n endTime?: Date,\n ) {\n this.containerClient = containerClient;\n this.segmentFactory = segmentFactory;\n this.years = years || [];\n this.segments = segments || [];\n this.currentSegment = currentSegment;\n this.lastConsumable = lastConsumable;\n this.startTime = startTime;\n this.endTime = endTime;\n if (this.lastConsumable) {\n this.end = minDate(this.lastConsumable, this.endTime);\n }\n }\n\n private async advanceSegmentIfNecessary(options: ChangeFeedGetChangeOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"ChangeFeed-advanceSegmentIfNecessary\",\n options,\n async (updatedOptions) => {\n if (!this.currentSegment) {\n throw new Error(\"Empty Change Feed shouldn't call this function.\");\n }\n\n // If the current segment has more Events, we don't need to do anything.\n if (this.currentSegment.hasNext()) {\n return;\n }\n\n // If the current segment is completed, remove it\n if (this.segments.length > 0) {\n this.currentSegment = await this.segmentFactory!.create(\n this.containerClient!,\n this.segments.shift()!,\n undefined,\n {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n },\n );\n }\n // If segments is empty, refill it\n else if (this.segments.length === 0 && this.years.length > 0) {\n const year = this.years.shift();\n this.segments = await getSegmentsInYear(\n this.containerClient!,\n year!,\n this.startTime,\n this.end,\n {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n },\n );\n\n if (this.segments.length > 0) {\n this.currentSegment = await this.segmentFactory!.create(\n this.containerClient!,\n this.segments.shift()!,\n undefined,\n {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n },\n );\n } else {\n this.currentSegment = undefined;\n }\n }\n },\n );\n }\n\n public hasNext(): boolean {\n // Empty ChangeFeed, using currentSegment as the indicator.\n if (!this.currentSegment) {\n return false;\n }\n\n if (this.segments.length === 0 && this.years.length === 0 && !this.currentSegment.hasNext()) {\n return false;\n }\n\n return this.currentSegment.dateTime < this.end!;\n }\n\n public async getChange(\n options: ChangeFeedGetChangeOptions = {},\n ): Promise<BlobChangeFeedEvent | undefined> {\n return tracingClient.withSpan(\"ChangeFeed-getChange\", options, async (updatedOptions) => {\n let event: BlobChangeFeedEvent | undefined = undefined;\n while (event === undefined && this.hasNext()) {\n event = await this.currentSegment!.getChange({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n await this.advanceSegmentIfNecessary({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n }\n return event;\n });\n }\n\n public getCursor(): ChangeFeedCursor {\n if (!this.currentSegment) {\n throw new Error(\"Empty Change Feed shouldn't call this function.\");\n }\n\n return {\n CursorVersion: 1,\n UrlHost: getHost(this.containerClient!.url)!,\n EndTime: this.endTime?.toJSON(),\n CurrentSegmentCursor: this.currentSegment!.getCursor(),\n };\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { BlobServiceClient } from "@azure/storage-blob";
2
- import { ChangeFeed } from "./ChangeFeed";
3
- import { SegmentFactory } from "./SegmentFactory";
4
- import type { BlobChangeFeedListChangesOptions } from "./models/models";
2
+ import { ChangeFeed } from "./ChangeFeed.js";
3
+ import { SegmentFactory } from "./SegmentFactory.js";
4
+ import type { BlobChangeFeedListChangesOptions } from "./models/models.js";
5
5
  export declare class ChangeFeedFactory {
6
6
  private readonly segmentFactory;
7
7
  private readonly maxTransferSize?;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeFeedFactory.d.ts","sourceRoot":"","sources":["../../src/ChangeFeedFactory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAa7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAe3E,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAS;gBAE9B,eAAe,CAAC,EAAE,MAAM;gBACxB,cAAc,EAAE,cAAc;IA0B1C,OAAO,CAAC,MAAM,CAAC,cAAc;IAShB,MAAM,CACjB,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,CAAC,EAAE,MAAM,EAC1B,OAAO,GAAE,gCAAqC,GAC7C,OAAO,CAAC,UAAU,CAAC;CA0GvB"}