@ms-cloudpack/remote-cache 0.9.19 → 0.10.0
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/{AzureRemoteCacheClient-2PTNMOT6.js → AzureRemoteCacheClient-XD7JMDG2.js} +61 -66
- package/dist/{chunk-RMB6VPNI.js → chunk-AAHKL65V.js} +845 -58
- package/dist/{chunk-LTZT5O5D.js → chunk-RCTPZOA2.js} +7 -16
- package/dist/{getCredential-KVHUWSLC.js → getCredential-L2ZQELGO.js} +6 -8
- package/dist/{getListOfBlobs-3HS5OH6K.js → getListOfBlobs-EY2E5AZT.js} +2 -13
- package/dist/index.js +22 -12
- package/lib/AzureRemoteCacheClient.d.ts +2 -2
- package/lib/createCacheStorageConfig.d.ts +2 -2
- package/lib/getListOfBlobs.d.ts +2 -2
- package/lib/index.d.ts +0 -1
- package/package.json +4 -4
- package/dist/chunk-KLSW7CDL.js +0 -807
- package/lib/types/RemoteCacheClientOptions.d.ts +0 -7
|
@@ -4,18 +4,16 @@ import topLevelUrl from 'node:url';
|
|
|
4
4
|
const require = topLevelCreateRequire(import.meta.url);
|
|
5
5
|
const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
|
-
import {
|
|
8
|
-
require_commonjs as require_commonjs2,
|
|
9
|
-
require_commonjs2 as require_commonjs3,
|
|
10
|
-
require_commonjs3 as require_commonjs4,
|
|
11
|
-
require_commonjs4 as require_commonjs5,
|
|
12
|
-
require_commonjs5 as require_commonjs6
|
|
13
|
-
} from "./chunk-RMB6VPNI.js";
|
|
14
7
|
import {
|
|
15
8
|
init_tslib_es6,
|
|
16
9
|
require_commonjs,
|
|
10
|
+
require_commonjs2,
|
|
11
|
+
require_commonjs3,
|
|
12
|
+
require_commonjs4,
|
|
13
|
+
require_commonjs5,
|
|
14
|
+
require_commonjs6,
|
|
17
15
|
tslib_es6_exports
|
|
18
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AAHKL65V.js";
|
|
19
17
|
import {
|
|
20
18
|
__commonJS,
|
|
21
19
|
__name,
|
|
@@ -27378,13 +27376,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
|
|
27378
27376
|
}
|
|
27379
27377
|
});
|
|
27380
27378
|
|
|
27381
|
-
// src/createBlobStorageUrl.ts
|
|
27382
|
-
function createBlobStorageUrl(storageAccount) {
|
|
27383
|
-
return `https://${storageAccount}.blob.core.windows.net`;
|
|
27384
|
-
}
|
|
27385
|
-
__name(createBlobStorageUrl, "createBlobStorageUrl");
|
|
27386
|
-
|
|
27387
27379
|
export {
|
|
27388
|
-
require_dist
|
|
27389
|
-
createBlobStorageUrl
|
|
27380
|
+
require_dist
|
|
27390
27381
|
};
|
|
@@ -8,15 +8,13 @@ import {
|
|
|
8
8
|
require_package as require_package2
|
|
9
9
|
} from "./chunk-N4V3CONX.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
require_commonjs3,
|
|
13
|
-
require_commonjs4,
|
|
14
|
-
require_commonjs5,
|
|
11
|
+
require_commonjs,
|
|
12
|
+
require_commonjs3 as require_commonjs2,
|
|
13
|
+
require_commonjs4 as require_commonjs3,
|
|
14
|
+
require_commonjs5 as require_commonjs4,
|
|
15
|
+
require_commonjs6 as require_commonjs5,
|
|
15
16
|
require_package
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import {
|
|
18
|
-
require_commonjs
|
|
19
|
-
} from "./chunk-KLSW7CDL.js";
|
|
17
|
+
} from "./chunk-AAHKL65V.js";
|
|
20
18
|
import {
|
|
21
19
|
__commonJS,
|
|
22
20
|
__esm,
|
|
@@ -5,22 +5,11 @@ const require = topLevelCreateRequire(import.meta.url);
|
|
|
5
5
|
const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
require_dist
|
|
10
|
-
} from "./chunk-LTZT5O5D.js";
|
|
11
|
-
import "./chunk-RMB6VPNI.js";
|
|
12
|
-
import "./chunk-KLSW7CDL.js";
|
|
13
|
-
import {
|
|
14
|
-
__name,
|
|
15
|
-
__toESM
|
|
8
|
+
__name
|
|
16
9
|
} from "./chunk-NFU5RQB4.js";
|
|
17
10
|
|
|
18
11
|
// src/getListOfBlobs.ts
|
|
19
|
-
|
|
20
|
-
async function getListOfBlobs(options) {
|
|
21
|
-
const { container, storageAccount, credential } = options;
|
|
22
|
-
const blobStorageClient = new import_storage_blob.BlobServiceClient(createBlobStorageUrl(storageAccount), credential);
|
|
23
|
-
const containerClient = blobStorageClient.getContainerClient(container);
|
|
12
|
+
async function getListOfBlobs(containerClient) {
|
|
24
13
|
const blobs = /* @__PURE__ */ new Set();
|
|
25
14
|
for await (const blob of containerClient.listBlobsByHierarchy("/")) {
|
|
26
15
|
if (blob.kind === "blob") {
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,15 @@ import topLevelUrl from 'node:url';
|
|
|
4
4
|
const require = topLevelCreateRequire(import.meta.url);
|
|
5
5
|
const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
require_dist
|
|
9
|
+
} from "./chunk-RCTPZOA2.js";
|
|
7
10
|
import {
|
|
8
11
|
require_commonjs
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AAHKL65V.js";
|
|
10
13
|
import {
|
|
11
|
-
__name
|
|
14
|
+
__name,
|
|
15
|
+
__toESM
|
|
12
16
|
} from "./chunk-NFU5RQB4.js";
|
|
13
17
|
|
|
14
18
|
// src/registerAzureLogger.ts
|
|
@@ -94,29 +98,35 @@ var blockListIsInvalidRetryPolicy = {
|
|
|
94
98
|
|
|
95
99
|
// src/createRemoteCacheClient.ts
|
|
96
100
|
import { RetryManager } from "@ms-cloudpack/retry";
|
|
101
|
+
|
|
102
|
+
// src/createBlobStorageUrl.ts
|
|
103
|
+
function createBlobStorageUrl(storageAccount) {
|
|
104
|
+
return `https://${storageAccount}.blob.core.windows.net`;
|
|
105
|
+
}
|
|
106
|
+
__name(createBlobStorageUrl, "createBlobStorageUrl");
|
|
107
|
+
|
|
108
|
+
// src/createRemoteCacheClient.ts
|
|
109
|
+
var import_storage_blob = __toESM(require_dist(), 1);
|
|
97
110
|
async function createRemoteCacheClient(params) {
|
|
98
111
|
const azureLogEventHandler = registerAzureLogger();
|
|
99
112
|
const { context, options } = params;
|
|
100
113
|
const { container, loginMethod, storageAccount, cachePath, tenantId } = options;
|
|
101
|
-
const { getCredential } = await import("./getCredential-
|
|
102
|
-
const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-
|
|
114
|
+
const { getCredential } = await import("./getCredential-L2ZQELGO.js");
|
|
115
|
+
const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-XD7JMDG2.js");
|
|
103
116
|
const { ReporterDecorator } = await import("./ReporterDecorator-FZKB4MWN.js");
|
|
104
|
-
const { getListOfBlobs } = await import("./getListOfBlobs-
|
|
117
|
+
const { getListOfBlobs } = await import("./getListOfBlobs-EY2E5AZT.js");
|
|
105
118
|
const credential = await getCredential(
|
|
106
119
|
{ loginMethod, cachePath, tenantId },
|
|
107
120
|
{ ...context, azureLogger: azureLogEventHandler }
|
|
108
121
|
);
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
credential
|
|
113
|
-
};
|
|
114
|
-
const listOfBlobs = await getListOfBlobs(remoteCacheClientOptions);
|
|
122
|
+
const blobStorageClient = new import_storage_blob.BlobServiceClient(createBlobStorageUrl(storageAccount), credential);
|
|
123
|
+
const containerClient = blobStorageClient.getContainerClient(container);
|
|
124
|
+
const listOfBlobs = await getListOfBlobs(containerClient);
|
|
115
125
|
const client = new ReporterDecorator(
|
|
116
126
|
new RetryDecorator({
|
|
117
127
|
retryManager: new RetryManager([blockListIsInvalidRetryPolicy]),
|
|
118
128
|
cacheClient: new InMemoryDecorator({
|
|
119
|
-
cacheClient: new AzureRemoteCacheClient(
|
|
129
|
+
cacheClient: new AzureRemoteCacheClient(containerClient),
|
|
120
130
|
getList: /* @__PURE__ */ __name(() => Promise.resolve(listOfBlobs), "getList")
|
|
121
131
|
})
|
|
122
132
|
}),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { RemoteCacheClient, RemoteCacheClientOperationOptions, RemoteCacheClientUploadOperationOptions } from './types/RemoteCacheClient.js';
|
|
2
|
-
import type {
|
|
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
|
-
constructor(
|
|
6
|
+
constructor(containerClient: ContainerClient);
|
|
7
7
|
/**
|
|
8
8
|
* Uploads the folder to the remote cache.
|
|
9
9
|
* @param id - The unique identifier of the asset to upload.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ContainerClient } from '@azure/storage-blob';
|
|
2
2
|
import type { CustomStorageConfig } from 'backfill-config';
|
|
3
|
-
export declare function createCacheStorageConfig(
|
|
3
|
+
export declare function createCacheStorageConfig(containerClient: ContainerClient): CustomStorageConfig;
|
|
4
4
|
//# sourceMappingURL=createCacheStorageConfig.d.ts.map
|
package/lib/getListOfBlobs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ContainerClient } from '@azure/storage-blob';
|
|
2
2
|
/**
|
|
3
3
|
* Gets all the blobs in the remote cache.
|
|
4
4
|
*/
|
|
5
|
-
export declare function getListOfBlobs(
|
|
5
|
+
export declare function getListOfBlobs(containerClient: ContainerClient): Promise<Set<string>>;
|
|
6
6
|
//# sourceMappingURL=getListOfBlobs.d.ts.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { createRemoteCacheClient, type CreateRemoteCacheClientParams } from './createRemoteCacheClient.js';
|
|
2
2
|
export type { RemoteCacheClient, RemoteCacheClientUploadOperationOptions, RemoteCacheClientOperationOptions, RemoteCacheClientOperationResult, } from './types/RemoteCacheClient.js';
|
|
3
3
|
export type { LoginMethod } from './types/LoginMethod.js';
|
|
4
|
-
export type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/remote-cache",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Manages syncing the local Cloudpack cached assets to/from a remote storage service.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"@ms-cloudpack/eslint-plugin-internal": "*",
|
|
46
46
|
"@ms-cloudpack/scripts": "*",
|
|
47
47
|
"@types/mime-types": "^2.0.0",
|
|
48
|
-
"backfill": "^6.2.
|
|
49
|
-
"backfill-cache": "^5.
|
|
50
|
-
"backfill-config": "^6.
|
|
48
|
+
"backfill": "^6.2.4",
|
|
49
|
+
"backfill-cache": "^5.9.0",
|
|
50
|
+
"backfill-config": "^6.5.0",
|
|
51
51
|
"backfill-logger": "^5.2.1"
|
|
52
52
|
}
|
|
53
53
|
}
|