@azure/storage-blob-changefeed 12.0.0-alpha.20230206.1 → 12.0.0-alpha.20230216.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +32 -152
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/BlobChangeFeedClient.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/ChangeFeed.js +5 -28
- package/dist-esm/storage-blob-changefeed/src/ChangeFeed.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/ChangeFeedFactory.js +3 -15
- package/dist-esm/storage-blob-changefeed/src/ChangeFeedFactory.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/Chunk.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/ChunkFactory.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/LazyLoadingBlobStream.js +7 -29
- package/dist-esm/storage-blob-changefeed/src/LazyLoadingBlobStream.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/Segment.js +3 -15
- package/dist-esm/storage-blob-changefeed/src/Segment.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/SegmentFactory.js +3 -15
- package/dist-esm/storage-blob-changefeed/src/SegmentFactory.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/Shard.js +3 -15
- package/dist-esm/storage-blob-changefeed/src/Shard.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/ShardFactory.js +4 -16
- package/dist-esm/storage-blob-changefeed/src/ShardFactory.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/models/models.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/utils/tracing.js +5 -3
- package/dist-esm/storage-blob-changefeed/src/utils/tracing.js.map +1 -1
- package/dist-esm/storage-blob-changefeed/src/utils/utils.common.js +9 -51
- package/dist-esm/storage-blob-changefeed/src/utils/utils.common.js.map +1 -1
- package/package.json +5 -3
- package/types/3.1/storage-blob-changefeed/src/BlobChangeFeedClient.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/ChangeFeed.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/Chunk.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/ChunkFactory.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/LazyLoadingBlobStream.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/Segment.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/SegmentFactory.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/Shard.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/ShardFactory.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/models/models.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/src/utils/tracing.d.ts +1 -6
- package/types/3.1/storage-blob-changefeed/src/utils/utils.common.d.ts +1 -8
- package/types/3.1/storage-blob-changefeed/test/utils/index.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed/test/utils/testutils.common.d.ts +1 -1
- package/types/3.1/storage-blob-changefeed.d.ts +2 -2
- package/types/latest/storage-blob-changefeed/src/BlobChangeFeedClient.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/ChangeFeed.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/ChangeFeed.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/ChangeFeedFactory.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/Chunk.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/Chunk.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/ChunkFactory.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/ChunkFactory.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/LazyLoadingBlobStream.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/LazyLoadingBlobStream.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/Segment.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/Segment.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/SegmentFactory.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/SegmentFactory.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/Shard.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/Shard.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/ShardFactory.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/ShardFactory.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/models/models.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/src/models/models.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/utils/tracing.d.ts +1 -6
- package/types/latest/storage-blob-changefeed/src/utils/tracing.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/src/utils/utils.common.d.ts +1 -8
- package/types/latest/storage-blob-changefeed/src/utils/utils.common.d.ts.map +1 -1
- package/types/latest/storage-blob-changefeed/test/utils/index.d.ts +1 -1
- package/types/latest/storage-blob-changefeed/test/utils/testutils.common.d.ts +1 -1
- package/types/latest/storage-blob-changefeed.d.ts +2 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import {
|
|
4
|
-
import { SpanStatusCode } from "@azure/core-tracing";
|
|
3
|
+
import { tracingClient } from "./utils/tracing";
|
|
5
4
|
export class Shard {
|
|
6
5
|
constructor(containerClient, chunkFactory, chunks, currentChunk, shardPath) {
|
|
7
6
|
this.shardPath = shardPath;
|
|
@@ -14,8 +13,7 @@ export class Shard {
|
|
|
14
13
|
return (this.chunks.length > 0 || (this.currentChunk !== undefined && this.currentChunk.hasNext()));
|
|
15
14
|
}
|
|
16
15
|
async getChange(options = {}) {
|
|
17
|
-
|
|
18
|
-
try {
|
|
16
|
+
return tracingClient.withSpan("Shard-getChange", options, async (updatedOptions) => {
|
|
19
17
|
let event = undefined;
|
|
20
18
|
while (event === undefined && this.hasNext()) {
|
|
21
19
|
event = await this.currentChunk.getChange();
|
|
@@ -28,17 +26,7 @@ export class Shard {
|
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
28
|
return event;
|
|
31
|
-
}
|
|
32
|
-
catch (e) {
|
|
33
|
-
span.setStatus({
|
|
34
|
-
code: SpanStatusCode.ERROR,
|
|
35
|
-
message: e.message,
|
|
36
|
-
});
|
|
37
|
-
throw e;
|
|
38
|
-
}
|
|
39
|
-
finally {
|
|
40
|
-
span.end();
|
|
41
|
-
}
|
|
29
|
+
});
|
|
42
30
|
}
|
|
43
31
|
getCursor() {
|
|
44
32
|
return this.currentChunk === undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shard.js","sourceRoot":"","sources":["../../../src/Shard.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Shard.js","sourceRoot":"","sources":["../../../src/Shard.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAahD,MAAM,OAAO,KAAK;IAShB,YACE,eAAgC,EAChC,YAA0B,EAC1B,MAAgB,EAChB,YAA+B,EACf,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;QAEjC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAEM,OAAO;QACZ,OAAO,CACL,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAC3F,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,SAAS,CACpB,UAAiC,EAAE;QAEnC,OAAO,aAAa,CAAC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;YACjF,IAAI,KAAK,GAAoC,SAAS,CAAC;YACvD,OAAO,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;gBAC5C,KAAK,GAAG,MAAM,IAAI,CAAC,YAAa,CAAC,SAAS,EAAE,CAAC;gBAE7C,sDAAsD;gBACtD,IAAI,CAAC,IAAI,CAAC,YAAa,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC3D,IAAI,CAAC,YAAY,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAChD,IAAI,CAAC,eAAe,EACpB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAG,EACpB,SAAS,EACT,SAAS,EACT;wBACE,WAAW,EAAE,OAAO,CAAC,WAAW;wBAChC,cAAc,EAAE,cAAc,CAAC,cAAc;qBAC9C,CACF,CAAC;iBACH;aACF;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,YAAY,KAAK,SAAS;YACpC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC;gBACE,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS;gBAC7C,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW;gBAC1C,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU;aACzC,CAAC;IACR,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ContainerClient, CommonOptions } from \"@azure/storage-blob\";\nimport { ChunkFactory } from \"./ChunkFactory\";\nimport { Chunk } from \"./Chunk\";\nimport { BlobChangeFeedEvent } from \"./models/BlobChangeFeedEvent\";\nimport { ShardCursor } from \"./models/ChangeFeedCursor\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { tracingClient } from \"./utils/tracing\";\n\n/**\n * Options to configure {@link Shard.getChange} operation.\n */\nexport interface ShardGetChangeOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\nexport class Shard {\n private readonly containerClient: ContainerClient;\n\n private readonly chunkFactory: ChunkFactory;\n\n private readonly chunks: string[];\n\n private currentChunk: Chunk | undefined;\n\n constructor(\n containerClient: ContainerClient,\n chunkFactory: ChunkFactory,\n chunks: string[],\n currentChunk: Chunk | undefined,\n public readonly shardPath: string\n ) {\n this.containerClient = containerClient;\n this.chunkFactory = chunkFactory;\n this.chunks = chunks;\n this.currentChunk = currentChunk;\n }\n\n public hasNext(): boolean {\n return (\n this.chunks.length > 0 || (this.currentChunk !== undefined && this.currentChunk.hasNext())\n );\n }\n\n public async getChange(\n options: ShardGetChangeOptions = {}\n ): Promise<BlobChangeFeedEvent | undefined> {\n return tracingClient.withSpan(\"Shard-getChange\", options, async (updatedOptions) => {\n let event: BlobChangeFeedEvent | undefined = undefined;\n while (event === undefined && this.hasNext()) {\n event = await this.currentChunk!.getChange();\n\n // Remove currentChunk if it doesn't have more events.\n if (!this.currentChunk!.hasNext() && this.chunks.length > 0) {\n this.currentChunk = await this.chunkFactory.create(\n this.containerClient,\n this.chunks.shift()!,\n undefined,\n undefined,\n {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n }\n );\n }\n }\n return event;\n });\n }\n\n public getCursor(): ShardCursor | undefined {\n return this.currentChunk === undefined\n ? undefined\n : {\n CurrentChunkPath: this.currentChunk.chunkPath,\n BlockOffset: this.currentChunk.blockOffset,\n EventIndex: this.currentChunk.eventIndex,\n };\n }\n}\n"]}
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
import { __asyncValues } from "tslib";
|
|
4
4
|
import { Shard } from "./Shard";
|
|
5
|
-
import {
|
|
6
|
-
import { createSpan } from "./utils/tracing";
|
|
5
|
+
import { tracingClient } from "./utils/tracing";
|
|
7
6
|
export class ShardFactory {
|
|
8
7
|
constructor(chunkFactory) {
|
|
9
8
|
this.chunkFactory = chunkFactory;
|
|
10
9
|
}
|
|
11
10
|
async create(containerClient, shardPath, shardCursor, options = {}) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
try {
|
|
11
|
+
return tracingClient.withSpan("ShardFactory-create", options, async (updatedOptions) => {
|
|
12
|
+
var e_1, _a;
|
|
15
13
|
const chunks = [];
|
|
16
14
|
const blockOffset = (shardCursor === null || shardCursor === void 0 ? void 0 : shardCursor.BlockOffset) || 0;
|
|
17
15
|
const eventIndex = (shardCursor === null || shardCursor === void 0 ? void 0 : shardCursor.EventIndex) || 0;
|
|
@@ -62,17 +60,7 @@ export class ShardFactory {
|
|
|
62
60
|
});
|
|
63
61
|
}
|
|
64
62
|
return new Shard(containerClient, this.chunkFactory, chunks, currentChunk, shardPath);
|
|
65
|
-
}
|
|
66
|
-
catch (e) {
|
|
67
|
-
span.setStatus({
|
|
68
|
-
code: SpanStatusCode.ERROR,
|
|
69
|
-
message: e.message,
|
|
70
|
-
});
|
|
71
|
-
throw e;
|
|
72
|
-
}
|
|
73
|
-
finally {
|
|
74
|
-
span.end();
|
|
75
|
-
}
|
|
63
|
+
});
|
|
76
64
|
}
|
|
77
65
|
}
|
|
78
66
|
//# sourceMappingURL=ShardFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShardFactory.js","sourceRoot":"","sources":["../../../src/ShardFactory.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAIlC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ShardFactory.js","sourceRoot":"","sources":["../../../src/ShardFactory.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C,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACtC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,gBAAgB,EAAE;4BAClC,UAAU,GAAG,CAAC,CAAC;4BACf,MAAM;yBACP;qBACF;oBACD,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE;wBACrB,MAAM,IAAI,KAAK,CAAC,SAAS,gBAAgB,aAAa,CAAC,CAAC;qBACzD;iBACF;qBAAM;oBACL,UAAU,GAAG,CAAC,CAAC;iBAChB;gBAED,iCAAiC;gBACjC,IAAI,UAAU,GAAG,CAAC,EAAE;oBAClB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;iBAC9B;gBAED,YAAY,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAC3C,eAAe,EACf,MAAM,CAAC,KAAK,EAAG,EACf,WAAW,EACX,UAAU,EACV;oBACE,WAAW,EAAE,OAAO,CAAC,WAAW;oBAChC,cAAc,EAAE,cAAc,CAAC,cAAc;iBAC9C,CACF,CAAC;aACH;YAED,OAAO,IAAI,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QACxF,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ChunkFactory } from \"./ChunkFactory\";\nimport { ShardCursor } from \"./models/ChangeFeedCursor\";\nimport { Shard } from \"./Shard\";\nimport { ContainerClient, CommonOptions } from \"@azure/storage-blob\";\nimport { Chunk } from \"./Chunk\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { tracingClient } from \"./utils/tracing\";\n\n/**\n * Options to configure {@link ShardFactory.create} operation.\n */\nexport interface CreateShardOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\nexport class ShardFactory {\n private readonly chunkFactory: ChunkFactory;\n\n constructor(chunkFactory: ChunkFactory) {\n this.chunkFactory = chunkFactory;\n }\n\n public async create(\n containerClient: ContainerClient,\n shardPath: string,\n shardCursor?: ShardCursor,\n options: CreateShardOptions = {}\n ): Promise<Shard> {\n return tracingClient.withSpan(\"ShardFactory-create\", options, async (updatedOptions) => {\n const chunks: string[] = [];\n const blockOffset: number = shardCursor?.BlockOffset || 0;\n const eventIndex: number = shardCursor?.EventIndex || 0;\n\n for await (const blobItem of containerClient.listBlobsFlat({\n prefix: shardPath,\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n })) {\n chunks.push(blobItem.name);\n }\n\n const currentChunkPath = shardCursor?.CurrentChunkPath;\n let chunkIndex = -1;\n let currentChunk: Chunk | undefined = undefined;\n // Chunks can be empty right after hour flips.\n if (chunks.length !== 0) {\n // Fast forward to current Chunk\n if (currentChunkPath) {\n for (let i = 0; i < chunks.length; i++) {\n if (chunks[i] === currentChunkPath) {\n chunkIndex = i;\n break;\n }\n }\n if (chunkIndex === -1) {\n throw new Error(`Chunk ${currentChunkPath} not found.`);\n }\n } else {\n chunkIndex = 0;\n }\n\n // Fast forward to current Chunk.\n if (chunkIndex > 0) {\n chunks.splice(0, chunkIndex);\n }\n\n currentChunk = await this.chunkFactory.create(\n containerClient,\n chunks.shift()!,\n blockOffset,\n eventIndex,\n {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n }\n );\n }\n\n return new Shard(containerClient, this.chunkFactory, chunks, currentChunk, shardPath);\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonOptions } from \"@azure/storage-blob\";\nimport { AbortSignalLike } from \"@azure/
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonOptions } from \"@azure/storage-blob\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\n\n/**\n * Options to configure {@link BlobChangeFeedClient.listChanges} operation.\n */\nexport interface BlobChangeFeedListChangesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Specify the start of the time range during which the change feed records will be fetched.\n * Note that for now the change feed client will round start time down to the nearest hour.\n */\n start?: Date;\n\n /**\n * Specify the end of the time range during which the change feed records will be fetched.\n * Note that for now the change feed client will round end time up to the nearest hour.\n */\n end?: Date;\n}\n"]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
-
import {
|
|
3
|
+
import { createTracingClient } from "@azure/core-tracing";
|
|
4
|
+
import { SDK_VERSION } from "./constants";
|
|
4
5
|
/**
|
|
5
6
|
* Creates a span using the global tracer.
|
|
6
7
|
* @internal
|
|
7
8
|
*/
|
|
8
|
-
export const
|
|
9
|
-
|
|
9
|
+
export const tracingClient = createTracingClient({
|
|
10
|
+
packageName: "@azure/storage-blob-changefeed",
|
|
11
|
+
packageVersion: SDK_VERSION,
|
|
10
12
|
namespace: "Microsoft.Storage",
|
|
11
13
|
});
|
|
12
14
|
//# sourceMappingURL=tracing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../../../src/utils/tracing.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../../../src/utils/tracing.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;IAC/C,WAAW,EAAE,gCAAgC;IAC7C,cAAc,EAAE,WAAW;IAC3B,SAAS,EAAE,mBAAmB;CAC/B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { createTracingClient } from \"@azure/core-tracing\";\nimport { SDK_VERSION } from \"./constants\";\n\n/**\n * Creates a span using the global tracer.\n * @internal\n */\nexport const tracingClient = createTracingClient({\n packageName: \"@azure/storage-blob-changefeed\",\n packageVersion: SDK_VERSION,\n namespace: \"Microsoft.Storage\",\n});\n"]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
import { __asyncValues } from "tslib";
|
|
4
|
-
import { URLBuilder } from "@azure/core-http";
|
|
5
4
|
import { CHANGE_FEED_SEGMENT_PREFIX, CHANGE_FEED_INITIALIZATION_SEGMENT } from "./constants";
|
|
6
|
-
import {
|
|
7
|
-
import { SpanStatusCode } from "@azure/core-tracing";
|
|
5
|
+
import { tracingClient } from "./tracing";
|
|
8
6
|
const millisecondsInAnHour = 60 * 60 * 1000;
|
|
9
7
|
export function ceilToNearestHour(date) {
|
|
10
8
|
if (date === undefined) {
|
|
@@ -24,31 +22,12 @@ export function floorToNearestHour(date) {
|
|
|
24
22
|
* @param url - Source URL string
|
|
25
23
|
*/
|
|
26
24
|
export function getHost(url) {
|
|
27
|
-
const urlParsed =
|
|
28
|
-
return urlParsed.
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Get URI from an URL string.
|
|
32
|
-
*
|
|
33
|
-
* @param url - Source URL string
|
|
34
|
-
*/
|
|
35
|
-
export function getURI(url) {
|
|
36
|
-
const urlParsed = URLBuilder.parse(url);
|
|
37
|
-
return `${urlParsed.getHost()}${urlParsed.getPort()}${urlParsed.getPath()}`;
|
|
38
|
-
}
|
|
39
|
-
// s[0]*31^(n - 1) + s[1]*31^(n - 2) + ... + s[n - 1]
|
|
40
|
-
export function hashString(str) {
|
|
41
|
-
let hash = 0;
|
|
42
|
-
for (let i = 0; i < str.length; i++) {
|
|
43
|
-
hash = (hash << 5) - hash + str.charCodeAt(i);
|
|
44
|
-
hash |= 0; // Bit operation converts operands to 32-bit integers
|
|
45
|
-
}
|
|
46
|
-
return hash;
|
|
25
|
+
const urlParsed = new URL(url);
|
|
26
|
+
return urlParsed.hostname;
|
|
47
27
|
}
|
|
48
28
|
export async function getYearsPaths(containerClient, options = {}) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
try {
|
|
29
|
+
return tracingClient.withSpan("getYearsPaths", options, async (updatedOptions) => {
|
|
30
|
+
var e_1, _a;
|
|
52
31
|
const years = [];
|
|
53
32
|
try {
|
|
54
33
|
for (var _b = __asyncValues(containerClient.listBlobsByHierarchy("/", {
|
|
@@ -71,22 +50,11 @@ export async function getYearsPaths(containerClient, options = {}) {
|
|
|
71
50
|
finally { if (e_1) throw e_1.error; }
|
|
72
51
|
}
|
|
73
52
|
return years.sort((a, b) => a - b);
|
|
74
|
-
}
|
|
75
|
-
catch (e) {
|
|
76
|
-
span.setStatus({
|
|
77
|
-
code: SpanStatusCode.ERROR,
|
|
78
|
-
message: e.message,
|
|
79
|
-
});
|
|
80
|
-
throw e;
|
|
81
|
-
}
|
|
82
|
-
finally {
|
|
83
|
-
span.end();
|
|
84
|
-
}
|
|
53
|
+
});
|
|
85
54
|
}
|
|
86
55
|
export async function getSegmentsInYear(containerClient, year, startTime, endTime, options = {}) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
try {
|
|
56
|
+
return tracingClient.withSpan("getSegmentsInYear", options, async (updatedOptions) => {
|
|
57
|
+
var e_2, _a;
|
|
90
58
|
const segments = [];
|
|
91
59
|
const yearBeginTime = new Date(Date.UTC(year, 0));
|
|
92
60
|
if (endTime && yearBeginTime >= endTime) {
|
|
@@ -115,17 +83,7 @@ export async function getSegmentsInYear(containerClient, year, startTime, endTim
|
|
|
115
83
|
finally { if (e_2) throw e_2.error; }
|
|
116
84
|
}
|
|
117
85
|
return segments;
|
|
118
|
-
}
|
|
119
|
-
catch (e) {
|
|
120
|
-
span.setStatus({
|
|
121
|
-
code: SpanStatusCode.ERROR,
|
|
122
|
-
message: e.message,
|
|
123
|
-
});
|
|
124
|
-
throw e;
|
|
125
|
-
}
|
|
126
|
-
finally {
|
|
127
|
-
span.end();
|
|
128
|
-
}
|
|
86
|
+
});
|
|
129
87
|
}
|
|
130
88
|
export function parseDateFromSegmentPath(segmentPath) {
|
|
131
89
|
const splitPath = segmentPath.split("/");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.common.js","sourceRoot":"","sources":["../../../../src/utils/utils.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,0BAA0B,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5C,MAAM,UAAU,iBAAiB,CAAC,IAAsB;IACtD,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,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;YAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC;SACtC;QAED,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtD,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;SAC/B;KACF;IAED,OAAO,QAA+B,CAAC;AACzC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { URLBuilder, AbortSignalLike } from \"@azure/core-http\";\nimport { ContainerClient, CommonOptions } from \"@azure/storage-blob\";\nimport { CHANGE_FEED_SEGMENT_PREFIX, CHANGE_FEED_INITIALIZATION_SEGMENT } from \"./constants\";\nimport { createSpan } from \"./tracing\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { BlobChangeFeedEvent, UpdatedBlobProperties } from \"../models/BlobChangeFeedEvent\";\n\nconst millisecondsInAnHour = 60 * 60 * 1000;\nexport function ceilToNearestHour(date: Date | undefined): Date | undefined {\n if (date === undefined) {\n return undefined;\n }\n return new Date(Math.ceil(date.getTime() / millisecondsInAnHour) * millisecondsInAnHour);\n}\n\nexport function floorToNearestHour(date: Date | undefined): Date | undefined {\n if (date === undefined) {\n return undefined;\n }\n return new Date(Math.floor(date.getTime() / millisecondsInAnHour) * millisecondsInAnHour);\n}\n\n/**\n * Get host from an URL string.\n *\n * @param url - Source URL string\n */\nexport function getHost(url: string): string | undefined {\n const urlParsed = URLBuilder.parse(url);\n return urlParsed.getHost();\n}\n\n/**\n * Get URI from an URL string.\n *\n * @param url - Source URL string\n */\nexport function getURI(url: string): string {\n const urlParsed = URLBuilder.parse(url);\n return `${urlParsed.getHost()}${urlParsed.getPort()}${urlParsed.getPath()}`;\n}\n\n// s[0]*31^(n - 1) + s[1]*31^(n - 2) + ... + s[n - 1]\nexport function hashString(str: string): number {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n hash = (hash << 5) - hash + str.charCodeAt(i);\n hash |= 0; // Bit operation converts operands to 32-bit integers\n }\n return hash;\n}\n\n/**\n * Options to configure {@link getYearsPaths} operation.\n */\nexport interface GetYearsPathsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\nexport async function getYearsPaths(\n containerClient: ContainerClient,\n options: GetYearsPathsOptions = {}\n): Promise<number[]> {\n const { span, updatedOptions } = createSpan(\"getYearsPaths\", options);\n try {\n const years: number[] = [];\n for await (const item of containerClient.listBlobsByHierarchy(\"/\", {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n prefix: CHANGE_FEED_SEGMENT_PREFIX,\n })) {\n if (item.kind === \"prefix\" && !item.name.includes(CHANGE_FEED_INITIALIZATION_SEGMENT)) {\n const yearStr = item.name.slice(CHANGE_FEED_SEGMENT_PREFIX.length, -1);\n years.push(parseInt(yearStr));\n }\n }\n return years.sort((a, b) => a - b);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n}\n\n/**\n * Options to configure {@link getSegmentsInYear} operation.\n */\nexport interface GetSegmentsInYearOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\nexport async function getSegmentsInYear(\n containerClient: ContainerClient,\n year: number,\n startTime?: Date,\n endTime?: Date,\n options: GetSegmentsInYearOptions = {}\n): Promise<string[]> {\n const { span, updatedOptions } = createSpan(\"getSegmentsInYear\", options);\n\n try {\n const segments: string[] = [];\n const yearBeginTime = new Date(Date.UTC(year, 0));\n if (endTime && yearBeginTime >= endTime) {\n return segments;\n }\n\n const prefix = `${CHANGE_FEED_SEGMENT_PREFIX}${year}/`;\n for await (const item of containerClient.listBlobsFlat({\n prefix,\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n })) {\n const segmentTime = parseDateFromSegmentPath(item.name);\n if ((startTime && segmentTime < startTime) || (endTime && segmentTime >= endTime)) {\n continue;\n }\n segments.push(item.name);\n }\n return segments;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n}\n\nexport function parseDateFromSegmentPath(segmentPath: string): Date {\n const splitPath = segmentPath.split(\"/\");\n if (splitPath.length < 3) {\n throw new Error(`${segmentPath} is not a valid segment path.`);\n }\n\n const segmentTime = new Date(0);\n segmentTime.setUTCFullYear(parseInt(splitPath[2]));\n\n if (splitPath.length >= 4) {\n segmentTime.setUTCMonth(parseInt(splitPath[3]) - 1);\n }\n if (splitPath.length >= 5) {\n segmentTime.setUTCDate(parseInt(splitPath[4]));\n }\n if (splitPath.length >= 6) {\n segmentTime.setUTCHours(parseInt(splitPath[5]) / 100);\n }\n return segmentTime;\n}\n\nexport function minDate(dateA: Date, dateB?: Date): Date {\n if (dateB && dateB < dateA) {\n return dateB;\n }\n return dateA;\n}\n\nexport function rawEventToBlobChangeFeedEvent(rawEvent: Record<string, any>): BlobChangeFeedEvent {\n if (rawEvent.eventTime) {\n rawEvent.eventTime = new Date(rawEvent.eventTime);\n }\n if (rawEvent.eTag) {\n rawEvent.etag = rawEvent.eTag;\n delete rawEvent.eTag;\n }\n if (rawEvent.data) {\n if (rawEvent.data.recursive !== undefined) {\n rawEvent.data.isRecursive = rawEvent.data.recursive;\n delete rawEvent.data.recursive;\n }\n if (rawEvent.data.previousInfo) {\n const previousInfo = rawEvent.data.previousInfo;\n\n if (previousInfo.SoftDeleteSnapshot) {\n previousInfo.softDeleteSnapshot = previousInfo.SoftDeleteSnapshot;\n delete previousInfo.SoftDeleteSnapshot;\n }\n if (previousInfo.WasBlobSoftDeleted) {\n previousInfo.isBlobSoftDeleted = previousInfo.WasBlobSoftDeleted === \"true\";\n delete previousInfo.WasBlobSoftDeleted;\n }\n if (previousInfo.BlobVersion) {\n previousInfo.newBlobVersion = previousInfo.BlobVersion;\n delete previousInfo.BlobVersion;\n }\n if (previousInfo.LastVersion) {\n previousInfo.oldBlobVersion = previousInfo.LastVersion;\n delete previousInfo.LastVersion;\n }\n if (previousInfo.PreviousTier) {\n previousInfo.previousTier = previousInfo.PreviousTier;\n delete previousInfo.PreviousTier;\n }\n\n rawEvent.data.previousInfo = previousInfo;\n }\n\n if (rawEvent.data.blobPropertiesUpdated) {\n const updatedBlobProperties: UpdatedBlobProperties = {};\n Object.entries(rawEvent.data.blobPropertiesUpdated).map((item) => {\n const blobPropertyChange = {\n propertyName: item[0],\n oldValue: (item[1] as any).previous as string,\n newValue: (item[1] as any).current as string,\n };\n updatedBlobProperties[item[0]] = blobPropertyChange;\n });\n rawEvent.data.updatedBlobProperties = updatedBlobProperties;\n delete rawEvent.data.blobPropertiesUpdated;\n }\n\n if (rawEvent.data.asyncOperationInfo) {\n const longRunningOperationInfo = rawEvent.data.asyncOperationInfo;\n if (longRunningOperationInfo.DestinationTier) {\n longRunningOperationInfo.destinationAccessTier = longRunningOperationInfo.DestinationTier;\n delete longRunningOperationInfo.DestinationTier;\n }\n if (\"WasAsyncOperation\" in longRunningOperationInfo) {\n longRunningOperationInfo.isAsync = longRunningOperationInfo.WasAsyncOperation === \"true\";\n delete longRunningOperationInfo.WasAsyncOperation;\n }\n if (longRunningOperationInfo.CopyId) {\n longRunningOperationInfo.copyId = longRunningOperationInfo.CopyId;\n delete longRunningOperationInfo.CopyId;\n }\n rawEvent.data.longRunningOperationInfo = longRunningOperationInfo;\n delete rawEvent.data.asyncOperationInfo;\n }\n\n if (rawEvent.data.blobTagsUpdated) {\n rawEvent.data.updatedBlobTags = {\n newTags: rawEvent.data.blobTagsUpdated.current,\n oldTags: rawEvent.data.blobTagsUpdated.previous,\n };\n\n delete rawEvent.data.blobTagsUpdated;\n }\n\n if (rawEvent.data.blobTier) {\n rawEvent.data.blobAccessTier = rawEvent.data.blobTier;\n delete rawEvent.data.blobTier;\n }\n }\n\n return rawEvent as BlobChangeFeedEvent;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.common.js","sourceRoot":"","sources":["../../../../src/utils/utils.common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAIlC,OAAO,EAAE,0BAA0B,EAAE,kCAAkC,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5C,MAAM,UAAU,iBAAiB,CAAC,IAAsB;IACtD,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,oBAAoB,CAAC,GAAG,oBAAoB,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAsB;IACvD,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,oBAAoB,CAAC,GAAG,oBAAoB,CAAC,CAAC;AAC5F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,SAAS,CAAC,QAAQ,CAAC;AAC5B,CAAC;AAaD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,eAAgC,EAChC,UAAgC,EAAE;IAElC,OAAO,aAAa,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;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,eAAe,EAAE;gBAC5C,wBAAwB,CAAC,qBAAqB,GAAG,wBAAwB,CAAC,eAAe,CAAC;gBAC1F,OAAO,wBAAwB,CAAC,eAAe,CAAC;aACjD;YACD,IAAI,mBAAmB,IAAI,wBAAwB,EAAE;gBACnD,wBAAwB,CAAC,OAAO,GAAG,wBAAwB,CAAC,iBAAiB,KAAK,MAAM,CAAC;gBACzF,OAAO,wBAAwB,CAAC,iBAAiB,CAAC;aACnD;YACD,IAAI,wBAAwB,CAAC,MAAM,EAAE;gBACnC,wBAAwB,CAAC,MAAM,GAAG,wBAAwB,CAAC,MAAM,CAAC;gBAClE,OAAO,wBAAwB,CAAC,MAAM,CAAC;aACxC;YACD,QAAQ,CAAC,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;YAClE,OAAO,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC;SACzC;QAED,IAAI,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE;YACjC,QAAQ,CAAC,IAAI,CAAC,eAAe,GAAG;gBAC9B,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO;gBAC9C,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ;aAChD,CAAC;YAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC;SACtC;QAED,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC1B,QAAQ,CAAC,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtD,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;SAC/B;KACF;IAED,OAAO,QAA+B,CAAC;AACzC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { ContainerClient, CommonOptions } from \"@azure/storage-blob\";\nimport { CHANGE_FEED_SEGMENT_PREFIX, CHANGE_FEED_INITIALIZATION_SEGMENT } from \"./constants\";\nimport { tracingClient } from \"./tracing\";\nimport { BlobChangeFeedEvent, UpdatedBlobProperties } from \"../models/BlobChangeFeedEvent\";\n\nconst millisecondsInAnHour = 60 * 60 * 1000;\nexport function ceilToNearestHour(date: Date | undefined): Date | undefined {\n if (date === undefined) {\n return undefined;\n }\n return new Date(Math.ceil(date.getTime() / millisecondsInAnHour) * millisecondsInAnHour);\n}\n\nexport function floorToNearestHour(date: Date | undefined): Date | undefined {\n if (date === undefined) {\n return undefined;\n }\n return new Date(Math.floor(date.getTime() / millisecondsInAnHour) * millisecondsInAnHour);\n}\n\n/**\n * Get host from an URL string.\n *\n * @param url - Source URL string\n */\nexport function getHost(url: string): string | undefined {\n const urlParsed = new URL(url);\n return urlParsed.hostname;\n}\n\n/**\n * Options to configure {@link getYearsPaths} operation.\n */\nexport interface GetYearsPathsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\nexport async function getYearsPaths(\n containerClient: ContainerClient,\n options: GetYearsPathsOptions = {}\n): Promise<number[]> {\n return tracingClient.withSpan(\"getYearsPaths\", options, async (updatedOptions) => {\n const years: number[] = [];\n for await (const item of containerClient.listBlobsByHierarchy(\"/\", {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n prefix: CHANGE_FEED_SEGMENT_PREFIX,\n })) {\n if (item.kind === \"prefix\" && !item.name.includes(CHANGE_FEED_INITIALIZATION_SEGMENT)) {\n const yearStr = item.name.slice(CHANGE_FEED_SEGMENT_PREFIX.length, -1);\n years.push(parseInt(yearStr));\n }\n }\n return years.sort((a, b) => a - b);\n });\n}\n\n/**\n * Options to configure {@link getSegmentsInYear} operation.\n */\nexport interface GetSegmentsInYearOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\nexport async function getSegmentsInYear(\n containerClient: ContainerClient,\n year: number,\n startTime?: Date,\n endTime?: Date,\n options: GetSegmentsInYearOptions = {}\n): Promise<string[]> {\n return tracingClient.withSpan(\"getSegmentsInYear\", options, async (updatedOptions) => {\n const segments: string[] = [];\n const yearBeginTime = new Date(Date.UTC(year, 0));\n if (endTime && yearBeginTime >= endTime) {\n return segments;\n }\n\n const prefix = `${CHANGE_FEED_SEGMENT_PREFIX}${year}/`;\n for await (const item of containerClient.listBlobsFlat({\n prefix,\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n })) {\n const segmentTime = parseDateFromSegmentPath(item.name);\n if ((startTime && segmentTime < startTime) || (endTime && segmentTime >= endTime)) {\n continue;\n }\n segments.push(item.name);\n }\n return segments;\n });\n}\n\nexport function parseDateFromSegmentPath(segmentPath: string): Date {\n const splitPath = segmentPath.split(\"/\");\n if (splitPath.length < 3) {\n throw new Error(`${segmentPath} is not a valid segment path.`);\n }\n\n const segmentTime = new Date(0);\n segmentTime.setUTCFullYear(parseInt(splitPath[2]));\n\n if (splitPath.length >= 4) {\n segmentTime.setUTCMonth(parseInt(splitPath[3]) - 1);\n }\n if (splitPath.length >= 5) {\n segmentTime.setUTCDate(parseInt(splitPath[4]));\n }\n if (splitPath.length >= 6) {\n segmentTime.setUTCHours(parseInt(splitPath[5]) / 100);\n }\n return segmentTime;\n}\n\nexport function minDate(dateA: Date, dateB?: Date): Date {\n if (dateB && dateB < dateA) {\n return dateB;\n }\n return dateA;\n}\n\nexport function rawEventToBlobChangeFeedEvent(rawEvent: Record<string, any>): BlobChangeFeedEvent {\n if (rawEvent.eventTime) {\n rawEvent.eventTime = new Date(rawEvent.eventTime);\n }\n if (rawEvent.eTag) {\n rawEvent.etag = rawEvent.eTag;\n delete rawEvent.eTag;\n }\n if (rawEvent.data) {\n if (rawEvent.data.recursive !== undefined) {\n rawEvent.data.isRecursive = rawEvent.data.recursive;\n delete rawEvent.data.recursive;\n }\n if (rawEvent.data.previousInfo) {\n const previousInfo = rawEvent.data.previousInfo;\n\n if (previousInfo.SoftDeleteSnapshot) {\n previousInfo.softDeleteSnapshot = previousInfo.SoftDeleteSnapshot;\n delete previousInfo.SoftDeleteSnapshot;\n }\n if (previousInfo.WasBlobSoftDeleted) {\n previousInfo.isBlobSoftDeleted = previousInfo.WasBlobSoftDeleted === \"true\";\n delete previousInfo.WasBlobSoftDeleted;\n }\n if (previousInfo.BlobVersion) {\n previousInfo.newBlobVersion = previousInfo.BlobVersion;\n delete previousInfo.BlobVersion;\n }\n if (previousInfo.LastVersion) {\n previousInfo.oldBlobVersion = previousInfo.LastVersion;\n delete previousInfo.LastVersion;\n }\n if (previousInfo.PreviousTier) {\n previousInfo.previousTier = previousInfo.PreviousTier;\n delete previousInfo.PreviousTier;\n }\n\n rawEvent.data.previousInfo = previousInfo;\n }\n\n if (rawEvent.data.blobPropertiesUpdated) {\n const updatedBlobProperties: UpdatedBlobProperties = {};\n Object.entries(rawEvent.data.blobPropertiesUpdated).map((item) => {\n const blobPropertyChange = {\n propertyName: item[0],\n oldValue: (item[1] as any).previous as string,\n newValue: (item[1] as any).current as string,\n };\n updatedBlobProperties[item[0]] = blobPropertyChange;\n });\n rawEvent.data.updatedBlobProperties = updatedBlobProperties;\n delete rawEvent.data.blobPropertiesUpdated;\n }\n\n if (rawEvent.data.asyncOperationInfo) {\n const longRunningOperationInfo = rawEvent.data.asyncOperationInfo;\n if (longRunningOperationInfo.DestinationTier) {\n longRunningOperationInfo.destinationAccessTier = longRunningOperationInfo.DestinationTier;\n delete longRunningOperationInfo.DestinationTier;\n }\n if (\"WasAsyncOperation\" in longRunningOperationInfo) {\n longRunningOperationInfo.isAsync = longRunningOperationInfo.WasAsyncOperation === \"true\";\n delete longRunningOperationInfo.WasAsyncOperation;\n }\n if (longRunningOperationInfo.CopyId) {\n longRunningOperationInfo.copyId = longRunningOperationInfo.CopyId;\n delete longRunningOperationInfo.CopyId;\n }\n rawEvent.data.longRunningOperationInfo = longRunningOperationInfo;\n delete rawEvent.data.asyncOperationInfo;\n }\n\n if (rawEvent.data.blobTagsUpdated) {\n rawEvent.data.updatedBlobTags = {\n newTags: rawEvent.data.blobTagsUpdated.current,\n oldTags: rawEvent.data.blobTagsUpdated.previous,\n };\n\n delete rawEvent.data.blobTagsUpdated;\n }\n\n if (rawEvent.data.blobTier) {\n rawEvent.data.blobAccessTier = rawEvent.data.blobTier;\n delete rawEvent.data.blobTier;\n }\n }\n\n return rawEvent as BlobChangeFeedEvent;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/storage-blob-changefeed",
|
|
3
3
|
"sdk-type": "client",
|
|
4
|
-
"version": "12.0.0-alpha.
|
|
4
|
+
"version": "12.0.0-alpha.20230216.2",
|
|
5
5
|
"description": "Microsoft Azure Storage SDK for JavaScript - Blob Change Feed",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist-esm/storage-blob-changefeed/src/index.js",
|
|
@@ -93,10 +93,12 @@
|
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@azure/storage-blob": "^12.12.0",
|
|
95
95
|
"@azure/abort-controller": "^1.0.0",
|
|
96
|
-
"@azure/core-
|
|
96
|
+
"@azure/core-auth": "^1.4.0",
|
|
97
|
+
"@azure/core-http-compat": "^2.0.0",
|
|
97
98
|
"@azure/core-lro": "^2.2.0",
|
|
98
99
|
"@azure/core-paging": "^1.1.1",
|
|
99
|
-
"@azure/core-
|
|
100
|
+
"@azure/core-rest-pipeline": "^1.10.1",
|
|
101
|
+
"@azure/core-tracing": "^1.0.0",
|
|
100
102
|
"@azure/logger": "^1.0.0",
|
|
101
103
|
"events": "^3.0.0",
|
|
102
104
|
"tslib": "^2.2.0"
|
|
@@ -2,7 +2,7 @@ import { StoragePipelineOptions, StorageSharedKeyCredential, AnonymousCredential
|
|
|
2
2
|
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
3
3
|
import { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
|
|
4
4
|
import { BlobChangeFeedListChangesOptions } from "./models/models";
|
|
5
|
-
import { TokenCredential } from "@azure/core-
|
|
5
|
+
import { TokenCredential } from "@azure/core-auth";
|
|
6
6
|
/**
|
|
7
7
|
* Contains paged response data for the {@link BlobChangeFeedClient.listChanges} operation.
|
|
8
8
|
*/
|
|
@@ -3,7 +3,7 @@ import { Segment } from "./Segment";
|
|
|
3
3
|
import { SegmentFactory } from "./SegmentFactory";
|
|
4
4
|
import { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
|
|
5
5
|
import { ChangeFeedCursor } from "./models/ChangeFeedCursor";
|
|
6
|
-
import { AbortSignalLike } from "@azure/
|
|
6
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
7
7
|
/**
|
|
8
8
|
* Options to configure {@link ChangeFeed.getChange} operation.
|
|
9
9
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AvroReader } from "../../storage-internal-avro/src";
|
|
2
2
|
import { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
|
|
3
3
|
import { CommonOptions } from "@azure/storage-blob";
|
|
4
|
-
import { AbortSignalLike } from "@azure/
|
|
4
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
5
5
|
import { AvroParseOptions } from "../../storage-internal-avro/src/AvroReader";
|
|
6
6
|
/**
|
|
7
7
|
* Options to configure {@link Chunk.getChange} operation.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AvroReaderFactory } from "./AvroReaderFactory";
|
|
2
2
|
import { ContainerClient, CommonOptions } from "@azure/storage-blob";
|
|
3
3
|
import { Chunk } from "./Chunk";
|
|
4
|
-
import { AbortSignalLike } from "@azure/
|
|
4
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
5
5
|
import { LazyLoadingBlobStreamFactory } from "./LazyLoadingBlobStreamFactory";
|
|
6
6
|
/**
|
|
7
7
|
* Options to configure {@link ChunkFactory.create} operation.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Readable, ReadableOptions } from "stream";
|
|
3
3
|
import { BlobClient, CommonOptions } from "@azure/storage-blob";
|
|
4
|
-
import { AbortSignalLike } from "@azure/
|
|
4
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
5
5
|
/**
|
|
6
6
|
* Options to configure the LazyLoadingBlobStream.
|
|
7
7
|
*/
|
|
@@ -2,7 +2,7 @@ import { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
|
|
|
2
2
|
import { Shard } from "./Shard";
|
|
3
3
|
import { SegmentCursor } from "./models/ChangeFeedCursor";
|
|
4
4
|
import { CommonOptions } from "@azure/storage-blob";
|
|
5
|
-
import { AbortSignalLike } from "@azure/
|
|
5
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
6
6
|
/**
|
|
7
7
|
* Options to configure {@link Segment.getChange} operation.
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@ import { ShardFactory } from "./ShardFactory";
|
|
|
2
2
|
import { ContainerClient, CommonOptions } from "@azure/storage-blob";
|
|
3
3
|
import { Segment } from "./Segment";
|
|
4
4
|
import { SegmentCursor } from "./models/ChangeFeedCursor";
|
|
5
|
-
import { AbortSignalLike } from "@azure/
|
|
5
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
6
6
|
export interface SegmentManifest {
|
|
7
7
|
version?: number;
|
|
8
8
|
begin?: Date;
|
|
@@ -3,7 +3,7 @@ import { ChunkFactory } from "./ChunkFactory";
|
|
|
3
3
|
import { Chunk } from "./Chunk";
|
|
4
4
|
import { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
|
|
5
5
|
import { ShardCursor } from "./models/ChangeFeedCursor";
|
|
6
|
-
import { AbortSignalLike } from "@azure/
|
|
6
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
7
7
|
/**
|
|
8
8
|
* Options to configure {@link Shard.getChange} operation.
|
|
9
9
|
*/
|
|
@@ -2,7 +2,7 @@ import { ChunkFactory } from "./ChunkFactory";
|
|
|
2
2
|
import { ShardCursor } from "./models/ChangeFeedCursor";
|
|
3
3
|
import { Shard } from "./Shard";
|
|
4
4
|
import { ContainerClient, CommonOptions } from "@azure/storage-blob";
|
|
5
|
-
import { AbortSignalLike } from "@azure/
|
|
5
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
6
6
|
/**
|
|
7
7
|
* Options to configure {@link ShardFactory.create} operation.
|
|
8
8
|
*/
|
|
@@ -2,10 +2,5 @@
|
|
|
2
2
|
* Creates a span using the global tracer.
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
6
|
-
tracingOptions?: import("@azure/core-tracing").OperationTracingOptions | undefined;
|
|
7
|
-
}>(operationName: string, operationOptions: T | undefined) => {
|
|
8
|
-
span: import("@azure/core-tracing").Span;
|
|
9
|
-
updatedOptions: T;
|
|
10
|
-
};
|
|
5
|
+
export declare const tracingClient: import("@azure/core-tracing").TracingClient;
|
|
11
6
|
//# sourceMappingURL=tracing.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbortSignalLike } from "@azure/
|
|
1
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
2
2
|
import { ContainerClient, CommonOptions } from "@azure/storage-blob";
|
|
3
3
|
import { BlobChangeFeedEvent } from "../models/BlobChangeFeedEvent";
|
|
4
4
|
export declare function ceilToNearestHour(date: Date | undefined): Date | undefined;
|
|
@@ -9,13 +9,6 @@ export declare function floorToNearestHour(date: Date | undefined): Date | undef
|
|
|
9
9
|
* @param url - Source URL string
|
|
10
10
|
*/
|
|
11
11
|
export declare function getHost(url: string): string | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Get URI from an URL string.
|
|
14
|
-
*
|
|
15
|
-
* @param url - Source URL string
|
|
16
|
-
*/
|
|
17
|
-
export declare function getURI(url: string): string;
|
|
18
|
-
export declare function hashString(str: string): number;
|
|
19
12
|
/**
|
|
20
13
|
* Options to configure {@link getYearsPaths} operation.
|
|
21
14
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StorageSharedKeyCredential, BlobServiceClient, StoragePipelineOptions } from "@azure/storage-blob";
|
|
2
2
|
import { BlobChangeFeedClient } from "../../src";
|
|
3
|
-
import { TokenCredential } from "@azure/core-
|
|
3
|
+
import { TokenCredential } from "@azure/core-auth";
|
|
4
4
|
export * from "./testutils.common";
|
|
5
5
|
export declare function getGenericCredential(accountType: string): StorageSharedKeyCredential;
|
|
6
6
|
export declare function getGenericBSU(accountType: string, accountNameSuffix?: string): BlobServiceClient;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-
|
|
2
|
+
import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-auth";
|
|
3
3
|
import { RecorderEnvironmentSetup } from "@azure-tools/test-recorder";
|
|
4
4
|
import { Readable } from "stream";
|
|
5
5
|
export declare const testPollerProperties: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AbortSignalLike } from '@azure/
|
|
1
|
+
import { AbortSignalLike } from '@azure/abort-controller';
|
|
2
2
|
import { AnonymousCredential } from '@azure/storage-blob';
|
|
3
3
|
import { CommonOptions } from '@azure/storage-blob';
|
|
4
4
|
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
5
5
|
import { Pipeline } from '@azure/storage-blob';
|
|
6
6
|
import { StoragePipelineOptions } from '@azure/storage-blob';
|
|
7
7
|
import { StorageSharedKeyCredential } from '@azure/storage-blob';
|
|
8
|
-
import { TokenCredential } from '@azure/core-
|
|
8
|
+
import { TokenCredential } from '@azure/core-auth';
|
|
9
9
|
/**
|
|
10
10
|
* The AccessTier.
|
|
11
11
|
*/
|
|
@@ -2,7 +2,7 @@ import { StoragePipelineOptions, StorageSharedKeyCredential, AnonymousCredential
|
|
|
2
2
|
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
3
3
|
import { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
|
|
4
4
|
import { BlobChangeFeedListChangesOptions } from "./models/models";
|
|
5
|
-
import { TokenCredential } from "@azure/core-
|
|
5
|
+
import { TokenCredential } from "@azure/core-auth";
|
|
6
6
|
/**
|
|
7
7
|
* Contains paged response data for the {@link BlobChangeFeedClient.listChanges} operation.
|
|
8
8
|
*/
|
|
@@ -3,7 +3,7 @@ import { Segment } from "./Segment";
|
|
|
3
3
|
import { SegmentFactory } from "./SegmentFactory";
|
|
4
4
|
import { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
|
|
5
5
|
import { ChangeFeedCursor } from "./models/ChangeFeedCursor";
|
|
6
|
-
import { AbortSignalLike } from "@azure/
|
|
6
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
7
7
|
/**
|
|
8
8
|
* Options to configure {@link ChangeFeed.getChange} operation.
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChangeFeed.d.ts","sourceRoot":"","sources":["../../../../src/ChangeFeed.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ChangeFeed.d.ts","sourceRoot":"","sources":["../../../../src/ChangeFeed.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE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ts","sourceRoot":"","sources":["../../../../src/ChangeFeedFactory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAmB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChangeFeedFactory.d.ts","sourceRoot":"","sources":["../../../../src/ChangeFeedFactory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAmB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AASnE,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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AvroReader } from "../../storage-internal-avro/src";
|
|
2
2
|
import { BlobChangeFeedEvent } from "./models/BlobChangeFeedEvent";
|
|
3
3
|
import { CommonOptions } from "@azure/storage-blob";
|
|
4
|
-
import { AbortSignalLike } from "@azure/
|
|
4
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
5
5
|
import { AvroParseOptions } from "../../storage-internal-avro/src/AvroReader";
|
|
6
6
|
/**
|
|
7
7
|
* Options to configure {@link Chunk.getChange} operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chunk.d.ts","sourceRoot":"","sources":["../../../../src/Chunk.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Chunk.d.ts","sourceRoot":"","sources":["../../../../src/Chunk.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAG9E;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,qBAAa,KAAK;aAkBE,SAAS,EAAE,MAAM;IAjBnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoD;IAEzE,OAAO,CAAC,YAAY,CAAS;IAC7B,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,OAAO,CAAC,WAAW,CAAS;IAC5B,IAAW,UAAU,IAAI,MAAM,CAE9B;gBAGC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EACF,SAAS,EAAE,MAAM,EACjC,WAAW,GAAE,gBAAqB;IAS7B,OAAO,IAAI,OAAO;IAIZ,SAAS,IAAI,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;CAmBnE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AvroReaderFactory } from "./AvroReaderFactory";
|
|
2
2
|
import { ContainerClient, CommonOptions } from "@azure/storage-blob";
|
|
3
3
|
import { Chunk } from "./Chunk";
|
|
4
|
-
import { AbortSignalLike } from "@azure/
|
|
4
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
5
5
|
import { LazyLoadingBlobStreamFactory } from "./LazyLoadingBlobStreamFactory";
|
|
6
6
|
/**
|
|
7
7
|
* Options to configure {@link ChunkFactory.create} operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChunkFactory.d.ts","sourceRoot":"","sources":["../../../../src/ChunkFactory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ChunkFactory.d.ts","sourceRoot":"","sources":["../../../../src/ChunkFactory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAG9E;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAA+B;IAC5E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAS;gBAGxC,iBAAiB,EAAE,iBAAiB,EACpC,4BAA4B,EAAE,4BAA4B,EAC1D,eAAe,CAAC,EAAE,MAAM;IAOb,MAAM,CACjB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,KAAK,CAAC;CAiClB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Readable, ReadableOptions } from "stream";
|
|
3
3
|
import { BlobClient, CommonOptions } from "@azure/storage-blob";
|
|
4
|
-
import { AbortSignalLike } from "@azure/
|
|
4
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
5
5
|
/**
|
|
6
6
|
* Options to configure the LazyLoadingBlobStream.
|
|
7
7
|
*/
|