@ms-cloudpack/remote-cache 0.10.16 → 0.10.17
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.
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRequire as topLevelCreateRequire } from 'node:module';
|
|
2
|
+
import topLevelPath from 'node:path';
|
|
3
|
+
import topLevelUrl from 'node:url';
|
|
4
|
+
const require = topLevelCreateRequire(import.meta.url);
|
|
5
|
+
const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = topLevelPath.dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
__name
|
|
9
|
+
} from "./chunk-NFU5RQB4.js";
|
|
10
|
+
|
|
11
|
+
// src/getListOfBlobs.ts
|
|
12
|
+
async function getListOfBlobs(containerClient, context) {
|
|
13
|
+
const { reporter, telemetryClient } = context;
|
|
14
|
+
const task = reporter.addTask("Get list of remote cached bundles");
|
|
15
|
+
try {
|
|
16
|
+
const result = await telemetryClient.tracer.startActiveSpan("GET_LIST_OF_BLOBS", async (span) => {
|
|
17
|
+
const blobs = /* @__PURE__ */ new Set();
|
|
18
|
+
for await (const blob of containerClient.listBlobsByHierarchy("/")) {
|
|
19
|
+
if (blob.kind === "blob") {
|
|
20
|
+
blobs.add(blob.name);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
span.setAttribute("count", blobs.size);
|
|
24
|
+
return blobs;
|
|
25
|
+
});
|
|
26
|
+
task.complete();
|
|
27
|
+
return result;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
task.complete({
|
|
30
|
+
errors: [String(error)]
|
|
31
|
+
});
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
__name(getListOfBlobs, "getListOfBlobs");
|
|
36
|
+
export {
|
|
37
|
+
getListOfBlobs
|
|
38
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -4779,14 +4779,14 @@ async function createRemoteCacheClient(params) {
|
|
|
4779
4779
|
const { getCredential } = await import("./getCredential-7S2VXY5L.js");
|
|
4780
4780
|
const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-7MHTRZ6Y.js");
|
|
4781
4781
|
const { ReporterDecorator } = await import("./ReporterDecorator-VYNWC6CL.js");
|
|
4782
|
-
const { getListOfBlobs } = await import("./getListOfBlobs-
|
|
4782
|
+
const { getListOfBlobs } = await import("./getListOfBlobs-BGP2V7PV.js");
|
|
4783
4783
|
const credential = await getCredential(
|
|
4784
4784
|
{ loginMethod, cachePath, tenantId },
|
|
4785
4785
|
{ ...context, azureLogger: azureLogEventHandler }
|
|
4786
4786
|
);
|
|
4787
4787
|
const blobStorageClient = new import_storage_blob.BlobServiceClient(createBlobStorageUrl(storageAccount), credential);
|
|
4788
4788
|
const containerClient = blobStorageClient.getContainerClient(container);
|
|
4789
|
-
const listOfBlobs = await getListOfBlobs(containerClient);
|
|
4789
|
+
const listOfBlobs = await getListOfBlobs(containerClient, context);
|
|
4790
4790
|
const client = new ReporterDecorator(
|
|
4791
4791
|
new RetryDecorator({
|
|
4792
4792
|
retryManager: new RetryManager([blockListIsInvalidRetryPolicy]),
|
package/lib/getListOfBlobs.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { ContainerClient } from '@azure/storage-blob';
|
|
2
|
+
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
3
|
+
import type { TelemetryClient } from '@ms-cloudpack/telemetry';
|
|
2
4
|
/**
|
|
3
5
|
* Gets all the blobs in the remote cache.
|
|
4
6
|
*/
|
|
5
|
-
export declare function getListOfBlobs(containerClient: ContainerClient
|
|
7
|
+
export declare function getListOfBlobs(containerClient: ContainerClient, context: {
|
|
8
|
+
reporter: TaskReporter;
|
|
9
|
+
telemetryClient: TelemetryClient;
|
|
10
|
+
}): Promise<Set<string>>;
|
|
6
11
|
//# sourceMappingURL=getListOfBlobs.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createRequire as topLevelCreateRequire } from 'node:module';
|
|
2
|
-
import topLevelPath from 'node:path';
|
|
3
|
-
import topLevelUrl from 'node:url';
|
|
4
|
-
const require = topLevelCreateRequire(import.meta.url);
|
|
5
|
-
const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = topLevelPath.dirname(__filename);
|
|
7
|
-
import {
|
|
8
|
-
__name
|
|
9
|
-
} from "./chunk-NFU5RQB4.js";
|
|
10
|
-
|
|
11
|
-
// src/getListOfBlobs.ts
|
|
12
|
-
async function getListOfBlobs(containerClient) {
|
|
13
|
-
const blobs = /* @__PURE__ */ new Set();
|
|
14
|
-
for await (const blob of containerClient.listBlobsByHierarchy("/")) {
|
|
15
|
-
if (blob.kind === "blob") {
|
|
16
|
-
blobs.add(blob.name);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return blobs;
|
|
20
|
-
}
|
|
21
|
-
__name(getListOfBlobs, "getListOfBlobs");
|
|
22
|
-
export {
|
|
23
|
-
getListOfBlobs
|
|
24
|
-
};
|