@ms-cloudpack/remote-cache 0.10.15 → 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
@@ -8,7 +8,7 @@ import {
8
8
  require_commonjs as require_commonjs5,
9
9
  require_commonjs2 as require_commonjs7,
10
10
  require_dist
11
- } from "./chunk-EZBP4ZKN.js";
11
+ } from "./chunk-RN46OLEJ.js";
12
12
  import {
13
13
  init_tslib_es6,
14
14
  require_commonjs,
@@ -17,7 +17,7 @@ import {
17
17
  require_commonjs5 as require_commonjs4,
18
18
  require_commonjs6,
19
19
  tslib_es6_exports
20
- } from "./chunk-E464X2TG.js";
20
+ } from "./chunk-J5MDMYM3.js";
21
21
  import {
22
22
  __commonJS,
23
23
  __name,
@@ -4690,6 +4690,8 @@ __name(registerAzureLogger, "registerAzureLogger");
4690
4690
 
4691
4691
  // src/decorators/InMemoryDecorator.ts
4692
4692
  var _InMemoryDecorator = class _InMemoryDecorator {
4693
+ cacheClient;
4694
+ list;
4693
4695
  constructor(options) {
4694
4696
  this.cacheClient = options.cacheClient;
4695
4697
  this.list = options.getList();
@@ -4716,6 +4718,8 @@ var InMemoryDecorator = _InMemoryDecorator;
4716
4718
 
4717
4719
  // src/decorators/RetryDecorator.ts
4718
4720
  var _RetryDecorator = class _RetryDecorator {
4721
+ cacheClient;
4722
+ retryManager;
4719
4723
  constructor(options) {
4720
4724
  this.cacheClient = options.cacheClient;
4721
4725
  this.retryManager = options.retryManager;
@@ -4772,17 +4776,17 @@ async function createRemoteCacheClient(params) {
4772
4776
  const azureLogEventHandler = registerAzureLogger();
4773
4777
  const { context, options } = params;
4774
4778
  const { container, loginMethod, storageAccount, cachePath, tenantId } = options;
4775
- const { getCredential } = await import("./getCredential-OSAAVWZC.js");
4776
- const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-AY675HJK.js");
4779
+ const { getCredential } = await import("./getCredential-7S2VXY5L.js");
4780
+ const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-7MHTRZ6Y.js");
4777
4781
  const { ReporterDecorator } = await import("./ReporterDecorator-VYNWC6CL.js");
4778
- const { getListOfBlobs } = await import("./getListOfBlobs-EY2E5AZT.js");
4782
+ const { getListOfBlobs } = await import("./getListOfBlobs-BGP2V7PV.js");
4779
4783
  const credential = await getCredential(
4780
4784
  { loginMethod, cachePath, tenantId },
4781
4785
  { ...context, azureLogger: azureLogEventHandler }
4782
4786
  );
4783
4787
  const blobStorageClient = new import_storage_blob.BlobServiceClient(createBlobStorageUrl(storageAccount), credential);
4784
4788
  const containerClient = blobStorageClient.getContainerClient(container);
4785
- const listOfBlobs = await getListOfBlobs(containerClient);
4789
+ const listOfBlobs = await getListOfBlobs(containerClient, context);
4786
4790
  const client = new ReporterDecorator(
4787
4791
  new RetryDecorator({
4788
4792
  retryManager: new RetryManager([blockListIsInvalidRetryPolicy]),
@@ -4837,6 +4841,8 @@ var _AzureAppRegistryClient = class _AzureAppRegistryClient {
4837
4841
  this.appsTableClient = new import_data_tables.TableClient(storageUrl, "apps", credential);
4838
4842
  this.appVersionsTableClient = new import_data_tables.TableClient(storageUrl, "appVersions", credential);
4839
4843
  }
4844
+ appsTableClient;
4845
+ appVersionsTableClient;
4840
4846
  /**
4841
4847
  * Registers an application and its version details in the table storage.
4842
4848
  */
@@ -4922,7 +4928,7 @@ async function createAppRegistryClient(params) {
4922
4928
  const { context, options } = params;
4923
4929
  const { loginMethod, cachePath, tenantId = defaultTenantId, storageAccount = defaultStorageAccount } = options;
4924
4930
  const azureLogEventHandler = registerAzureLogger();
4925
- const { getCredential } = await import("./getCredential-OSAAVWZC.js");
4931
+ const { getCredential } = await import("./getCredential-7S2VXY5L.js");
4926
4932
  const credential = await getCredential(
4927
4933
  { loginMethod, cachePath, tenantId },
4928
4934
  { ...context, azureLogger: azureLogEventHandler }
@@ -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): Promise<Set<string>>;
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/remote-cache",
3
- "version": "0.10.15",
3
+ "version": "0.10.17",
4
4
  "description": "Manages syncing the local Cloudpack cached assets to/from a remote storage service.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,8 +30,8 @@
30
30
  "@ms-cloudpack/common-types": "^0.24.10",
31
31
  "@ms-cloudpack/environment": "^0.1.1",
32
32
  "@ms-cloudpack/retry": "^0.1.3",
33
- "@ms-cloudpack/task-reporter": "^0.15.1",
34
- "@ms-cloudpack/telemetry": "^0.10.18",
33
+ "@ms-cloudpack/task-reporter": "^0.16.0",
34
+ "@ms-cloudpack/telemetry": "^0.10.19",
35
35
  "@napi-rs/keyring": "^1.0.0",
36
36
  "mime-types": "^2.0.0",
37
37
  "node-dpapi-prebuilt": "^1.0.3"
@@ -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
- };