@ms-cloudpack/remote-cache 0.10.6 → 0.10.7

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.
@@ -47422,13 +47422,6 @@ var _AzureRemoteCacheClient = class _AzureRemoteCacheClient {
47422
47422
  cacheStorageConfig: createCacheStorageConfig(containerClient)
47423
47423
  };
47424
47424
  }
47425
- /**
47426
- * Uploads the folder to the remote cache.
47427
- * @param id - The unique identifier of the asset to upload.
47428
- * @param path - The path to the folder to upload.
47429
- * @param globMatches - The glob pattern to use when uploading the folder.
47430
- * @returns - A promise that resolves when the folder has been uploaded.
47431
- */
47432
47425
  async uploadFolder(options) {
47433
47426
  const { id, path, globMatches } = options;
47434
47427
  if (!fs.existsSync(path)) {
@@ -47437,12 +47430,6 @@ var _AzureRemoteCacheClient = class _AzureRemoteCacheClient {
47437
47430
  await (0, import_api.put)(path, id, this.logger, { ...this.config, outputGlob: globMatches });
47438
47431
  return "success";
47439
47432
  }
47440
- /**
47441
- * Downloads the folder from the remote cache.
47442
- * @param id - The unique identifier of the asset to download.
47443
- * @param path - The path to download the folder to.
47444
- * @returns - A promise that resolves when the folder has been downloaded.
47445
- */
47446
47433
  async downloadFolder(options) {
47447
47434
  const { id, path } = options;
47448
47435
  if (fs.existsSync(path)) {
package/dist/index.js CHANGED
@@ -112,7 +112,7 @@ async function createRemoteCacheClient(params) {
112
112
  const { context, options } = params;
113
113
  const { container, loginMethod, storageAccount, cachePath, tenantId } = options;
114
114
  const { getCredential } = await import("./getCredential-GVAO2BWN.js");
115
- const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-XD7JMDG2.js");
115
+ const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-GTJWKYFP.js");
116
116
  const { ReporterDecorator } = await import("./ReporterDecorator-VYNWC6CL.js");
117
117
  const { getListOfBlobs } = await import("./getListOfBlobs-EY2E5AZT.js");
118
118
  const credential = await getCredential(
@@ -1,23 +1,10 @@
1
- import type { RemoteCacheClient, RemoteCacheClientOperationOptions, RemoteCacheClientUploadOperationOptions } from './types/RemoteCacheClient.js';
1
+ import type { RemoteCacheClient, RemoteCacheClientOperationOptions, RemoteCacheClientOperationResult, RemoteCacheClientUploadOperationOptions } from './types/RemoteCacheClient.js';
2
2
  import type { ContainerClient } from '@azure/storage-blob';
3
3
  export declare class AzureRemoteCacheClient implements RemoteCacheClient {
4
4
  private readonly logger;
5
5
  private readonly config;
6
6
  constructor(containerClient: ContainerClient);
7
- /**
8
- * Uploads the folder to the remote cache.
9
- * @param id - The unique identifier of the asset to upload.
10
- * @param path - The path to the folder to upload.
11
- * @param globMatches - The glob pattern to use when uploading the folder.
12
- * @returns - A promise that resolves when the folder has been uploaded.
13
- */
14
- uploadFolder(options: RemoteCacheClientUploadOperationOptions): Promise<'success' | 'not-found'>;
15
- /**
16
- * Downloads the folder from the remote cache.
17
- * @param id - The unique identifier of the asset to download.
18
- * @param path - The path to download the folder to.
19
- * @returns - A promise that resolves when the folder has been downloaded.
20
- */
21
- downloadFolder(options: RemoteCacheClientOperationOptions): Promise<'success' | 'not-found' | 'already-exist'>;
7
+ uploadFolder(options: RemoteCacheClientUploadOperationOptions): Promise<RemoteCacheClientOperationResult>;
8
+ downloadFolder(options: RemoteCacheClientOperationOptions): Promise<RemoteCacheClientOperationResult>;
22
9
  }
23
10
  //# sourceMappingURL=AzureRemoteCacheClient.d.ts.map
@@ -14,10 +14,25 @@ export interface RemoteCacheClientOperationOptions {
14
14
  friendlyName: string;
15
15
  }
16
16
  export interface RemoteCacheClientUploadOperationOptions extends RemoteCacheClientOperationOptions {
17
+ /** The glob pattern to use when uploading the folder. */
17
18
  globMatches: string[];
18
19
  }
19
20
  export interface RemoteCacheClient {
21
+ /**
22
+ * Uploads the folder to the remote cache.
23
+ * @returns
24
+ * - `'not-found'` if the path does not exist locally
25
+ * - `'already-exist'` if a resource with the same id already exists in the remote cache
26
+ * - `'success'` if the upload was successful
27
+ */
20
28
  uploadFolder(options: RemoteCacheClientUploadOperationOptions): Promise<RemoteCacheClientOperationResult>;
29
+ /**
30
+ * Downloads the folder from the remote cache.
31
+ * @returns
32
+ * - `'already-exist'` if the specified path already exists locally
33
+ * - `'not-found'` if the asset is not found in the remote cache
34
+ * - `'success'` if the download was successful
35
+ */
21
36
  downloadFolder(options: RemoteCacheClientOperationOptions): Promise<RemoteCacheClientOperationResult>;
22
37
  }
23
38
  //# sourceMappingURL=RemoteCacheClient.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/remote-cache",
3
- "version": "0.10.6",
3
+ "version": "0.10.7",
4
4
  "description": "Manages syncing the local Cloudpack cached assets to/from a remote storage service.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,11 +27,11 @@
27
27
  "lib/**/*.d.ts"
28
28
  ],
29
29
  "dependencies": {
30
- "@ms-cloudpack/common-types": "^0.24.3",
30
+ "@ms-cloudpack/common-types": "^0.24.4",
31
31
  "@ms-cloudpack/environment": "^0.1.1",
32
32
  "@ms-cloudpack/retry": "^0.1.3",
33
- "@ms-cloudpack/task-reporter": "^0.14.8",
34
- "@ms-cloudpack/telemetry": "^0.10.10",
33
+ "@ms-cloudpack/task-reporter": "^0.15.0",
34
+ "@ms-cloudpack/telemetry": "^0.10.11",
35
35
  "@napi-rs/keyring": "^1.0.0",
36
36
  "mime-types": "^2.0.0",
37
37
  "node-dpapi-prebuilt": "^1.0.3"