@azure/storage-blob-changefeed 12.0.0-alpha.20220413.1 → 12.0.0-alpha.20220414.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +82 -9
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/Chunk.js +2 -8
- package/dist-esm/storage-blob-changefeed/src/Chunk.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/models/BlobChangeFeedEvent.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/utils/utils.common.js +81 -0
- package/dist-esm/storage-blob-changefeed/src/utils/utils.common.js.map +1 -1
- package/package.json +1 -1
- package/types/3.1/storage-blob-changefeed/src/models/BlobChangeFeedEvent.d.ts +140 -1
- package/types/3.1/storage-blob-changefeed/src/utils/utils.common.d.ts +2 -0
- package/types/3.1/storage-blob-changefeed/test/utils/testutils.common.d.ts +8 -0
- package/types/3.1/storage-blob-changefeed.d.ts +140 -1
- package/types/latest/storage-blob-changefeed/src/Chunk.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/models/BlobChangeFeedEvent.d.ts +140 -1
- package/types/latest/storage-blob-changefeed/src/models/BlobChangeFeedEvent.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/utils/utils.common.d.ts +2 -0
- package/types/latest/storage-blob-changefeed/src/utils/utils.common.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/test/utils/testutils.common.d.ts +8 -0
- package/types/latest/storage-blob-changefeed/test/utils/testutils.common.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed.d.ts +146 -1
package/dist/index.js
CHANGED
|
@@ -159,6 +159,87 @@ function minDate(dateA, dateB) {
|
|
|
159
159
|
}
|
|
160
160
|
return dateA;
|
|
161
161
|
}
|
|
162
|
+
function rawEventToBlobChangeFeedEvent(rawEvent) {
|
|
163
|
+
if (rawEvent.eventTime) {
|
|
164
|
+
rawEvent.eventTime = new Date(rawEvent.eventTime);
|
|
165
|
+
}
|
|
166
|
+
if (rawEvent.eTag) {
|
|
167
|
+
rawEvent.etag = rawEvent.eTag;
|
|
168
|
+
delete rawEvent.eTag;
|
|
169
|
+
}
|
|
170
|
+
if (rawEvent.data) {
|
|
171
|
+
if (rawEvent.data.recursive !== undefined) {
|
|
172
|
+
rawEvent.data.isRecursive = rawEvent.data.recursive;
|
|
173
|
+
delete rawEvent.data.recursive;
|
|
174
|
+
}
|
|
175
|
+
if (rawEvent.data.previousInfo) {
|
|
176
|
+
let previousInfo = rawEvent.data.previousInfo;
|
|
177
|
+
if (previousInfo.SoftDeleteSnapshot) {
|
|
178
|
+
previousInfo.softDeleteSnapshot = previousInfo.SoftDeleteSnapshot;
|
|
179
|
+
delete previousInfo.SoftDeleteSnapshot;
|
|
180
|
+
}
|
|
181
|
+
if (previousInfo.WasBlobSoftDeleted) {
|
|
182
|
+
previousInfo.isBlobSoftDeleted = previousInfo.WasBlobSoftDeleted;
|
|
183
|
+
delete previousInfo.WasBlobSoftDeleted;
|
|
184
|
+
}
|
|
185
|
+
if (previousInfo.BlobVersion) {
|
|
186
|
+
previousInfo.newBlobVersion = previousInfo.BlobVersion;
|
|
187
|
+
delete previousInfo.BlobVersion;
|
|
188
|
+
}
|
|
189
|
+
if (previousInfo.LastVersion) {
|
|
190
|
+
previousInfo.oldBlobVersion = previousInfo.LastVersion;
|
|
191
|
+
delete previousInfo.LastVersion;
|
|
192
|
+
}
|
|
193
|
+
if (previousInfo.PreviousTier) {
|
|
194
|
+
previousInfo.previousTier = previousInfo.PreviousTier;
|
|
195
|
+
delete previousInfo.PreviousTier;
|
|
196
|
+
}
|
|
197
|
+
rawEvent.data.previousInfo = previousInfo;
|
|
198
|
+
}
|
|
199
|
+
if (rawEvent.data.blobPropertiesUpdated) {
|
|
200
|
+
let updatedBlobProperties = {};
|
|
201
|
+
Object.entries(rawEvent.data.blobPropertiesUpdated).map((item) => {
|
|
202
|
+
const blobPropertyChange = {
|
|
203
|
+
propertyName: item[0],
|
|
204
|
+
oldValue: item[1].previous,
|
|
205
|
+
newValue: item[1].current,
|
|
206
|
+
};
|
|
207
|
+
updatedBlobProperties[item[0]] = blobPropertyChange;
|
|
208
|
+
});
|
|
209
|
+
rawEvent.data.updatedBlobProperties = updatedBlobProperties;
|
|
210
|
+
delete rawEvent.data.blobPropertiesUpdated;
|
|
211
|
+
}
|
|
212
|
+
if (rawEvent.data.asyncOperationInfo) {
|
|
213
|
+
let longRunningOperationInfo = rawEvent.data.asyncOperationInfo;
|
|
214
|
+
if (longRunningOperationInfo.DestinationTier) {
|
|
215
|
+
longRunningOperationInfo.destinationAccessTier = longRunningOperationInfo.DestinationTier;
|
|
216
|
+
delete longRunningOperationInfo.DestinationTier;
|
|
217
|
+
}
|
|
218
|
+
if ("WasAsyncOperation" in longRunningOperationInfo) {
|
|
219
|
+
longRunningOperationInfo.isAsync = longRunningOperationInfo.WasAsyncOperation === "true";
|
|
220
|
+
delete longRunningOperationInfo.WasAsyncOperation;
|
|
221
|
+
}
|
|
222
|
+
if (longRunningOperationInfo.CopyId) {
|
|
223
|
+
longRunningOperationInfo.copyId = longRunningOperationInfo.CopyId;
|
|
224
|
+
delete longRunningOperationInfo.CopyId;
|
|
225
|
+
}
|
|
226
|
+
rawEvent.data.longRunningOperationInfo = longRunningOperationInfo;
|
|
227
|
+
delete rawEvent.data.asyncOperationInfo;
|
|
228
|
+
}
|
|
229
|
+
if (rawEvent.data.blobTagsUpdated) {
|
|
230
|
+
rawEvent.data.updatedBlobTags = {
|
|
231
|
+
newTags: rawEvent.data.blobTagsUpdated.current,
|
|
232
|
+
oldTags: rawEvent.data.blobTagsUpdated.previous,
|
|
233
|
+
};
|
|
234
|
+
delete rawEvent.data.blobTagsUpdated;
|
|
235
|
+
}
|
|
236
|
+
if (rawEvent.data.blobTier) {
|
|
237
|
+
rawEvent.data.blobAccessTier = rawEvent.data.blobTier;
|
|
238
|
+
delete rawEvent.data.blobTier;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return rawEvent;
|
|
242
|
+
}
|
|
162
243
|
|
|
163
244
|
// Copyright (c) Microsoft Corporation.
|
|
164
245
|
class ChangeFeed {
|
|
@@ -1061,7 +1142,6 @@ class ShardFactory {
|
|
|
1061
1142
|
}
|
|
1062
1143
|
|
|
1063
1144
|
// Copyright (c) Microsoft Corporation.
|
|
1064
|
-
// Licensed under the MIT license.
|
|
1065
1145
|
class Chunk {
|
|
1066
1146
|
constructor(avroReader, blockOffset, eventIndex, chunkPath, avroOptions = {}) {
|
|
1067
1147
|
this.chunkPath = chunkPath;
|
|
@@ -1094,14 +1174,7 @@ class Chunk {
|
|
|
1094
1174
|
if (eventRaw === null) {
|
|
1095
1175
|
return undefined;
|
|
1096
1176
|
}
|
|
1097
|
-
|
|
1098
|
-
eventRaw.eventTime = new Date(eventRaw.eventTime);
|
|
1099
|
-
}
|
|
1100
|
-
if (eventRaw.eTag) {
|
|
1101
|
-
eventRaw.etag = eventRaw.eTag;
|
|
1102
|
-
delete eventRaw.eTag;
|
|
1103
|
-
}
|
|
1104
|
-
return eventRaw;
|
|
1177
|
+
return rawEventToBlobChangeFeedEvent(eventRaw);
|
|
1105
1178
|
}
|
|
1106
1179
|
}
|
|
1107
1180
|
}
|