@ms-cloudpack/remote-cache 0.5.4-beta.0 → 0.6.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 CHANGED
@@ -82,7 +82,7 @@ async function createRemoteCacheClient(params) {
82
82
  const { context, options } = params;
83
83
  const { container, loginMethod, storageAccount, cachePath } = options;
84
84
  const { getCredential } = await import("./getCredential-QMMPE77Q.js");
85
- const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-R5HCIW6L.js");
85
+ const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-NEV2XCF7.js");
86
86
  const { ReporterDecorator } = await import("./ReporterDecorator-SNBYNGOT.js");
87
87
  const { getListOfBlobs } = await import("./getListOfBlobs-E5OFG2MF.js");
88
88
  const credential = await getCredential(loginMethod, cachePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/remote-cache",
3
- "version": "0.5.4-beta.0",
3
+ "version": "0.6.1",
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,15 +30,15 @@
30
30
  "@azure/msal-node-extensions": "^1.0.10",
31
31
  "@ms-cloudpack/retry": "^0.1.1",
32
32
  "@ms-cloudpack/task-reporter": "^0.11.2",
33
- "@ms-cloudpack/telemetry": "^0.4.9-beta.0",
34
- "backfill": "^6.2.1",
35
- "backfill-config": "^6.4.1"
33
+ "@ms-cloudpack/telemetry": "^0.5.1"
36
34
  },
37
35
  "devDependencies": {
38
36
  "@azure/identity": "^4.0.0",
39
37
  "@azure/identity-cache-persistence": "^1.1.0",
40
38
  "@azure/storage-blob": "^12.17.0",
41
39
  "@ms-cloudpack/eslint-plugin-internal": "*",
42
- "@ms-cloudpack/scripts": "*"
40
+ "@ms-cloudpack/scripts": "*",
41
+ "backfill": "^6.2.1",
42
+ "backfill-config": "^6.4.1"
43
43
  }
44
44
  }
@@ -1,65 +0,0 @@
1
- import {
2
- createBlobStorageUrl
3
- } from "./chunk-R2VDVRDZ.js";
4
- import {
5
- __name,
6
- init_esbuildCjsShims
7
- } from "./chunk-TQLTL4XO.js";
8
-
9
- // src/AzureRemoteCacheClient.ts
10
- init_esbuildCjsShims();
11
- import { makeLogger, put, fetch } from "backfill/lib/api.js";
12
- import { existsSync } from "fs";
13
- var _AzureRemoteCacheClient = class _AzureRemoteCacheClient {
14
- constructor({ container, storageAccount, credential }) {
15
- this.logger = makeLogger("mute", process.stdout, process.stderr);
16
- this.config = {
17
- incrementalCaching: true,
18
- internalCacheFolder: "",
19
- // not used by azure-blob
20
- cacheStorageConfig: {
21
- provider: "azure-blob",
22
- options: {
23
- connectionString: createBlobStorageUrl(storageAccount),
24
- credential,
25
- container
26
- }
27
- }
28
- };
29
- }
30
- /**
31
- * Uploads the folder to the remote cache.
32
- * @param id - The unique identifier of the asset to upload.
33
- * @param path - The path to the folder to upload.
34
- * @param globMatches - The glob pattern to use when uploading the folder.
35
- * @returns - A promise that resolves when the folder has been uploaded.
36
- */
37
- async uploadFolder({ id, path, globMatches }) {
38
- if (!existsSync(path)) {
39
- return "not-found";
40
- }
41
- await put(path, id, this.logger, { ...this.config, outputGlob: globMatches });
42
- return "success";
43
- }
44
- /**
45
- * Downloads the folder from the remote cache.
46
- * @param id - The unique identifier of the asset to download.
47
- * @param path - The path to download the folder to.
48
- * @returns - A promise that resolves when the folder has been downloaded.
49
- */
50
- async downloadFolder({ id, path }) {
51
- if (existsSync(path)) {
52
- return "already-exist";
53
- }
54
- const result = await fetch(path, id, this.logger, this.config);
55
- if (!result) {
56
- return "not-found";
57
- }
58
- return "success";
59
- }
60
- };
61
- __name(_AzureRemoteCacheClient, "AzureRemoteCacheClient");
62
- var AzureRemoteCacheClient = _AzureRemoteCacheClient;
63
- export {
64
- AzureRemoteCacheClient
65
- };