@ms-cloudpack/remote-cache 0.8.16 → 0.9.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/{AzureRemoteCacheClient-RYQX2JZE.js → AzureRemoteCacheClient-MGVQID6U.js} +91 -36
- package/dist/{ReporterDecorator-V2YEIC5V.js → ReporterDecorator-GABX72QZ.js} +3 -3
- package/dist/{chunk-WR3ABZS6.js → chunk-FCLWQPWW.js} +2 -2
- package/dist/{chunk-PAESICSC.js → chunk-FWAX6DIR.js} +18 -3
- package/dist/{chunk-F35F2EJX.js → chunk-J2GVYUBP.js} +1 -1
- package/dist/{chunk-373ETHF2.js → chunk-QZWJDZ4T.js} +1 -1
- package/dist/{chunk-S3ZJNZYB.js → chunk-YJE37DFQ.js} +9 -9
- package/dist/{getCredential-TGHZRNZU.js → getCredential-HAVZEKRP.js} +3 -3
- package/dist/{getListOfBlobs-6GZGACOS.js → getListOfBlobs-S2XCR2P4.js} +8 -6
- package/dist/index.js +5 -5
- package/lib/AzureRemoteCacheClient.d.ts +2 -2
- package/lib/createCacheStorageConfig.d.ts +4 -0
- package/lib/index.d.ts +1 -1
- package/package.json +7 -3
|
@@ -6,22 +6,22 @@ const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
require_package as require_package2
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-J2GVYUBP.js";
|
|
10
10
|
import {
|
|
11
11
|
createBlobStorageUrl
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QZWJDZ4T.js";
|
|
13
13
|
import {
|
|
14
14
|
require_dist
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FCLWQPWW.js";
|
|
16
16
|
import {
|
|
17
17
|
require_package2 as require_package
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YJE37DFQ.js";
|
|
19
19
|
import {
|
|
20
20
|
__commonJS,
|
|
21
21
|
__name,
|
|
22
22
|
__require,
|
|
23
23
|
__toESM
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-FWAX6DIR.js";
|
|
25
25
|
|
|
26
26
|
// ../../node_modules/.store/p-try-npm-2.2.0-e0390dbaf8/package/index.js
|
|
27
27
|
var require_package3 = __commonJS({
|
|
@@ -1167,8 +1167,8 @@ var require_graceful_fs = __commonJS({
|
|
|
1167
1167
|
fs2.createReadStream = createReadStream;
|
|
1168
1168
|
fs2.createWriteStream = createWriteStream;
|
|
1169
1169
|
var fs$readFile = fs2.readFile;
|
|
1170
|
-
fs2.readFile =
|
|
1171
|
-
function
|
|
1170
|
+
fs2.readFile = readFile2;
|
|
1171
|
+
function readFile2(path, options, cb) {
|
|
1172
1172
|
if (typeof options === "function")
|
|
1173
1173
|
cb = options, options = null;
|
|
1174
1174
|
return go$readFile(path, options, cb);
|
|
@@ -1184,7 +1184,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1184
1184
|
}
|
|
1185
1185
|
__name(go$readFile, "go$readFile");
|
|
1186
1186
|
}
|
|
1187
|
-
__name(
|
|
1187
|
+
__name(readFile2, "readFile");
|
|
1188
1188
|
var fs$writeFile = fs2.writeFile;
|
|
1189
1189
|
fs2.writeFile = writeFile;
|
|
1190
1190
|
function writeFile(path, data, options, cb) {
|
|
@@ -3009,7 +3009,7 @@ var require_package16 = __commonJS({
|
|
|
3009
3009
|
} catch (_) {
|
|
3010
3010
|
_fs = __require("fs");
|
|
3011
3011
|
}
|
|
3012
|
-
function
|
|
3012
|
+
function readFile2(file, options, callback) {
|
|
3013
3013
|
if (callback == null) {
|
|
3014
3014
|
callback = options;
|
|
3015
3015
|
options = {};
|
|
@@ -3040,7 +3040,7 @@ var require_package16 = __commonJS({
|
|
|
3040
3040
|
callback(null, obj);
|
|
3041
3041
|
});
|
|
3042
3042
|
}
|
|
3043
|
-
__name(
|
|
3043
|
+
__name(readFile2, "readFile");
|
|
3044
3044
|
function readFileSync(file, options) {
|
|
3045
3045
|
options = options || {};
|
|
3046
3046
|
if (typeof options === "string") {
|
|
@@ -3111,7 +3111,7 @@ var require_package16 = __commonJS({
|
|
|
3111
3111
|
}
|
|
3112
3112
|
__name(stripBom, "stripBom");
|
|
3113
3113
|
var jsonfile = {
|
|
3114
|
-
readFile,
|
|
3114
|
+
readFile: readFile2,
|
|
3115
3115
|
readFileSync,
|
|
3116
3116
|
writeFile,
|
|
3117
3117
|
writeFileSync
|
|
@@ -18516,7 +18516,7 @@ var require_package40 = __commonJS({
|
|
|
18516
18516
|
}
|
|
18517
18517
|
const file = _ref22;
|
|
18518
18518
|
if (yield exists(file)) {
|
|
18519
|
-
return
|
|
18519
|
+
return readFile2(file);
|
|
18520
18520
|
}
|
|
18521
18521
|
}
|
|
18522
18522
|
return null;
|
|
@@ -18535,7 +18535,7 @@ var require_package40 = __commonJS({
|
|
|
18535
18535
|
})();
|
|
18536
18536
|
let readJsonAndFile = exports2.readJsonAndFile = (() => {
|
|
18537
18537
|
var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
|
|
18538
|
-
const file = yield
|
|
18538
|
+
const file = yield readFile2(loc);
|
|
18539
18539
|
try {
|
|
18540
18540
|
return {
|
|
18541
18541
|
object: (0, (_map || _load_map()).default)(JSON.parse(stripBOM(file))),
|
|
@@ -18775,7 +18775,7 @@ var require_package40 = __commonJS({
|
|
|
18775
18775
|
}, "getFirstSuitableFolder");
|
|
18776
18776
|
})();
|
|
18777
18777
|
exports2.copy = copy;
|
|
18778
|
-
exports2.readFile =
|
|
18778
|
+
exports2.readFile = readFile2;
|
|
18779
18779
|
exports2.readFileRaw = readFileRaw;
|
|
18780
18780
|
exports2.normalizeOS = normalizeOS;
|
|
18781
18781
|
var _fs;
|
|
@@ -18886,10 +18886,10 @@ var require_package40 = __commonJS({
|
|
|
18886
18886
|
});
|
|
18887
18887
|
}
|
|
18888
18888
|
__name(_readFile, "_readFile");
|
|
18889
|
-
function
|
|
18889
|
+
function readFile2(loc) {
|
|
18890
18890
|
return _readFile(loc, "utf8").then(normalizeOS);
|
|
18891
18891
|
}
|
|
18892
|
-
__name(
|
|
18892
|
+
__name(readFile2, "readFile");
|
|
18893
18893
|
function readFileRaw(loc) {
|
|
18894
18894
|
return _readFile(loc, "binary");
|
|
18895
18895
|
}
|
|
@@ -31334,7 +31334,7 @@ var require_async7 = __commonJS({
|
|
|
31334
31334
|
opts = normalizeOptions(x, opts);
|
|
31335
31335
|
var isFile = opts.isFile || defaultIsFile;
|
|
31336
31336
|
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
31337
|
-
var
|
|
31337
|
+
var readFile2 = opts.readFile || fs.readFile;
|
|
31338
31338
|
var realpath = opts.realpath || defaultRealpath;
|
|
31339
31339
|
var packageIterator = opts.packageIterator;
|
|
31340
31340
|
var extensions = opts.extensions || [".js"];
|
|
@@ -31452,7 +31452,7 @@ var require_async7 = __commonJS({
|
|
|
31452
31452
|
var pkgfile = path.join(pkgdir, "package.json");
|
|
31453
31453
|
isFile(pkgfile, function(err2, ex) {
|
|
31454
31454
|
if (!ex) return loadpkg(path.dirname(dir), cb2);
|
|
31455
|
-
|
|
31455
|
+
readFile2(pkgfile, function(err3, body) {
|
|
31456
31456
|
if (err3) cb2(err3);
|
|
31457
31457
|
try {
|
|
31458
31458
|
var pkg = JSON.parse(body);
|
|
@@ -31480,7 +31480,7 @@ var require_async7 = __commonJS({
|
|
|
31480
31480
|
isFile(pkgfile, function(err2, ex) {
|
|
31481
31481
|
if (err2) return cb2(err2);
|
|
31482
31482
|
if (!ex) return loadAsFile(path.join(x2, "index"), fpkg, cb2);
|
|
31483
|
-
|
|
31483
|
+
readFile2(pkgfile, function(err3, body) {
|
|
31484
31484
|
if (err3) return cb2(err3);
|
|
31485
31485
|
try {
|
|
31486
31486
|
var pkg = JSON.parse(body);
|
|
@@ -39601,7 +39601,7 @@ var require_buffer_list = __commonJS({
|
|
|
39601
39601
|
}, "clear")
|
|
39602
39602
|
}, {
|
|
39603
39603
|
key: "join",
|
|
39604
|
-
value: /* @__PURE__ */ __name(function
|
|
39604
|
+
value: /* @__PURE__ */ __name(function join2(s) {
|
|
39605
39605
|
if (this.length === 0) return "";
|
|
39606
39606
|
var p = this.head;
|
|
39607
39607
|
var ret = "" + p.data;
|
|
@@ -44880,8 +44880,8 @@ var require_CacheStorage = __commonJS({
|
|
|
44880
44880
|
}
|
|
44881
44881
|
};
|
|
44882
44882
|
__name(_CacheStorage, "CacheStorage");
|
|
44883
|
-
var
|
|
44884
|
-
exports.CacheStorage =
|
|
44883
|
+
var CacheStorage2 = _CacheStorage;
|
|
44884
|
+
exports.CacheStorage = CacheStorage2;
|
|
44885
44885
|
}
|
|
44886
44886
|
});
|
|
44887
44887
|
|
|
@@ -44965,8 +44965,8 @@ var require_AzureBlobCacheStorage = __commonJS({
|
|
|
44965
44965
|
maxBuffers: 5
|
|
44966
44966
|
};
|
|
44967
44967
|
async function createBlobClient(connectionString, containerName, blobName, credential) {
|
|
44968
|
-
const { BlobServiceClient } = await Promise.resolve().then(() => __importStar(require_dist()));
|
|
44969
|
-
const blobServiceClient = credential ? new
|
|
44968
|
+
const { BlobServiceClient: BlobServiceClient2 } = await Promise.resolve().then(() => __importStar(require_dist()));
|
|
44969
|
+
const blobServiceClient = credential ? new BlobServiceClient2(connectionString, credential) : BlobServiceClient2.fromConnectionString(connectionString);
|
|
44970
44970
|
const containerClient = blobServiceClient.getContainerClient(containerName);
|
|
44971
44971
|
const blobClient = containerClient.getBlobClient(blobName);
|
|
44972
44972
|
return blobClient;
|
|
@@ -47246,7 +47246,7 @@ var require_lib14 = __commonJS({
|
|
|
47246
47246
|
__name(isCustomProvider, "isCustomProvider");
|
|
47247
47247
|
exports.isCustomProvider = isCustomProvider;
|
|
47248
47248
|
var memo = /* @__PURE__ */ new Map();
|
|
47249
|
-
function
|
|
47249
|
+
function getCacheStorageProvider2(cacheStorageConfig, internalCacheFolder, logger, cwd, incrementalCaching = false) {
|
|
47250
47250
|
let cacheStorage;
|
|
47251
47251
|
if (isCustomProvider(cacheStorageConfig)) {
|
|
47252
47252
|
try {
|
|
@@ -47272,8 +47272,8 @@ var require_lib14 = __commonJS({
|
|
|
47272
47272
|
memo.set(key, cacheStorage);
|
|
47273
47273
|
return cacheStorage;
|
|
47274
47274
|
}
|
|
47275
|
-
__name(
|
|
47276
|
-
exports.getCacheStorageProvider =
|
|
47275
|
+
__name(getCacheStorageProvider2, "getCacheStorageProvider");
|
|
47276
|
+
exports.getCacheStorageProvider = getCacheStorageProvider2;
|
|
47277
47277
|
}
|
|
47278
47278
|
});
|
|
47279
47279
|
|
|
@@ -47356,21 +47356,76 @@ var require_api = __commonJS({
|
|
|
47356
47356
|
// src/AzureRemoteCacheClient.ts
|
|
47357
47357
|
var import_api = __toESM(require_api(), 1);
|
|
47358
47358
|
import { existsSync } from "fs";
|
|
47359
|
+
|
|
47360
|
+
// src/createCacheStorageConfig.ts
|
|
47361
|
+
var import_backfill_cache = __toESM(require_lib14(), 1);
|
|
47362
|
+
var import_storage_blob = __toESM(require_dist(), 1);
|
|
47363
|
+
import { join } from "path";
|
|
47364
|
+
import { readFile } from "fs/promises";
|
|
47365
|
+
import { lookup } from "mime-types";
|
|
47366
|
+
var _CustomAzureCacheStorage = class _CustomAzureCacheStorage extends import_backfill_cache.CacheStorage {
|
|
47367
|
+
constructor({ container, storageAccount, credential }, logger, cwd) {
|
|
47368
|
+
super(logger, cwd);
|
|
47369
|
+
this.logger = logger;
|
|
47370
|
+
this.cwd = cwd;
|
|
47371
|
+
const connectionString = createBlobStorageUrl(storageAccount);
|
|
47372
|
+
const blobStorageClient = new import_storage_blob.BlobServiceClient(connectionString, credential);
|
|
47373
|
+
this.containerClient = blobStorageClient.getContainerClient(container);
|
|
47374
|
+
const internalCacheFolder = "";
|
|
47375
|
+
this.tarStorage = (0, import_backfill_cache.getCacheStorageProvider)(
|
|
47376
|
+
{
|
|
47377
|
+
provider: "azure-blob",
|
|
47378
|
+
options: {
|
|
47379
|
+
connectionString,
|
|
47380
|
+
credential,
|
|
47381
|
+
container
|
|
47382
|
+
}
|
|
47383
|
+
},
|
|
47384
|
+
internalCacheFolder,
|
|
47385
|
+
logger,
|
|
47386
|
+
cwd
|
|
47387
|
+
);
|
|
47388
|
+
}
|
|
47389
|
+
_fetch(hash) {
|
|
47390
|
+
return this.tarStorage.fetch(hash);
|
|
47391
|
+
}
|
|
47392
|
+
async _put(hash, filesToCache) {
|
|
47393
|
+
await Promise.all([
|
|
47394
|
+
// Combine all the files in a tarball and upload it to the blob storage
|
|
47395
|
+
this.tarStorage.put(hash, filesToCache),
|
|
47396
|
+
// Upload the individual files to the blob storage
|
|
47397
|
+
...filesToCache.map(async (file) => {
|
|
47398
|
+
const filePath = join(this.cwd, file);
|
|
47399
|
+
const content = await readFile(filePath, { encoding: "utf-8" });
|
|
47400
|
+
const blockBlobClient = this.containerClient.getBlockBlobClient(`${hash}/${file}`);
|
|
47401
|
+
return blockBlobClient.upload(content, content.length, {
|
|
47402
|
+
blobHTTPHeaders: {
|
|
47403
|
+
blobContentType: lookup(file) || "application/octet-stream"
|
|
47404
|
+
}
|
|
47405
|
+
});
|
|
47406
|
+
})
|
|
47407
|
+
]);
|
|
47408
|
+
}
|
|
47409
|
+
};
|
|
47410
|
+
__name(_CustomAzureCacheStorage, "CustomAzureCacheStorage");
|
|
47411
|
+
var CustomAzureCacheStorage = _CustomAzureCacheStorage;
|
|
47412
|
+
function createCacheStorageConfig(remoteCacheClientOptions) {
|
|
47413
|
+
return {
|
|
47414
|
+
name: "Custom Azure Cache Storage",
|
|
47415
|
+
provider: /* @__PURE__ */ __name((logger, cwd) => new CustomAzureCacheStorage(remoteCacheClientOptions, logger, cwd), "provider")
|
|
47416
|
+
};
|
|
47417
|
+
}
|
|
47418
|
+
__name(createCacheStorageConfig, "createCacheStorageConfig");
|
|
47419
|
+
|
|
47420
|
+
// src/AzureRemoteCacheClient.ts
|
|
47359
47421
|
var _AzureRemoteCacheClient = class _AzureRemoteCacheClient {
|
|
47360
|
-
constructor(
|
|
47422
|
+
constructor(remoteCacheClientOptions) {
|
|
47361
47423
|
this.logger = (0, import_api.makeLogger)("mute", process.stdout, process.stderr);
|
|
47362
47424
|
this.config = {
|
|
47363
47425
|
incrementalCaching: true,
|
|
47364
47426
|
internalCacheFolder: "",
|
|
47365
47427
|
// not used by azure-blob
|
|
47366
|
-
cacheStorageConfig:
|
|
47367
|
-
provider: "azure-blob",
|
|
47368
|
-
options: {
|
|
47369
|
-
connectionString: createBlobStorageUrl(storageAccount),
|
|
47370
|
-
credential,
|
|
47371
|
-
container
|
|
47372
|
-
}
|
|
47373
|
-
}
|
|
47428
|
+
cacheStorageConfig: createCacheStorageConfig(remoteCacheClientOptions)
|
|
47374
47429
|
};
|
|
47375
47430
|
}
|
|
47376
47431
|
/**
|
|
@@ -6,12 +6,12 @@ const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
require_dist
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-FCLWQPWW.js";
|
|
10
|
+
import "./chunk-YJE37DFQ.js";
|
|
11
11
|
import {
|
|
12
12
|
__name,
|
|
13
13
|
__toESM
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FWAX6DIR.js";
|
|
15
15
|
|
|
16
16
|
// src/decorators/ReporterDecorator.ts
|
|
17
17
|
var import_storage_blob = __toESM(require_dist(), 1);
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
require_commonjs3 as require_commonjs4,
|
|
11
11
|
require_commonjs4 as require_commonjs5,
|
|
12
12
|
require_commonjs5 as require_commonjs6
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YJE37DFQ.js";
|
|
14
14
|
import {
|
|
15
15
|
__commonJS,
|
|
16
16
|
__name,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
init_tslib_es6,
|
|
20
20
|
require_commonjs,
|
|
21
21
|
tslib_es6_exports
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FWAX6DIR.js";
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/.store/@azure-core-auth-npm-1.8.0-4c3deacbe4/package/dist/commonjs/azureKeyCredential.js
|
|
25
25
|
var require_azureKeyCredential = __commonJS({
|
|
@@ -45,7 +45,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
45
45
|
));
|
|
46
46
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
47
47
|
|
|
48
|
-
// ../../node_modules/.store/tslib-npm-2.
|
|
48
|
+
// ../../node_modules/.store/tslib-npm-2.8.0-6ce3ffdd05/package/tslib.es6.mjs
|
|
49
49
|
var tslib_es6_exports = {};
|
|
50
50
|
__export(tslib_es6_exports, {
|
|
51
51
|
__addDisposableResource: () => __addDisposableResource,
|
|
@@ -73,6 +73,7 @@ __export(tslib_es6_exports, {
|
|
|
73
73
|
__propKey: () => __propKey,
|
|
74
74
|
__read: () => __read,
|
|
75
75
|
__rest: () => __rest,
|
|
76
|
+
__rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
|
|
76
77
|
__runInitializers: () => __runInitializers,
|
|
77
78
|
__setFunctionName: () => __setFunctionName,
|
|
78
79
|
__spread: () => __spread,
|
|
@@ -493,9 +494,17 @@ function __disposeResources(env) {
|
|
|
493
494
|
__name(next, "next");
|
|
494
495
|
return next();
|
|
495
496
|
}
|
|
497
|
+
function __rewriteRelativeImportExtension(path, preserveJsx) {
|
|
498
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
499
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
500
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
return path;
|
|
504
|
+
}
|
|
496
505
|
var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default;
|
|
497
506
|
var init_tslib_es6 = __esm({
|
|
498
|
-
"../../node_modules/.store/tslib-npm-2.
|
|
507
|
+
"../../node_modules/.store/tslib-npm-2.8.0-6ce3ffdd05/package/tslib.es6.mjs"() {
|
|
499
508
|
extendStatics = /* @__PURE__ */ __name(function(d, b) {
|
|
500
509
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
501
510
|
d2.__proto__ = b2;
|
|
@@ -565,12 +574,17 @@ var init_tslib_es6 = __esm({
|
|
|
565
574
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
566
575
|
};
|
|
567
576
|
__name(__disposeResources, "__disposeResources");
|
|
577
|
+
__name(__rewriteRelativeImportExtension, "__rewriteRelativeImportExtension");
|
|
568
578
|
tslib_es6_default = {
|
|
569
579
|
__extends,
|
|
570
580
|
__assign,
|
|
571
581
|
__rest,
|
|
572
582
|
__decorate,
|
|
573
583
|
__param,
|
|
584
|
+
__esDecorate,
|
|
585
|
+
__runInitializers,
|
|
586
|
+
__propKey,
|
|
587
|
+
__setFunctionName,
|
|
574
588
|
__metadata,
|
|
575
589
|
__awaiter,
|
|
576
590
|
__generator,
|
|
@@ -592,7 +606,8 @@ var init_tslib_es6 = __esm({
|
|
|
592
606
|
__classPrivateFieldSet,
|
|
593
607
|
__classPrivateFieldIn,
|
|
594
608
|
__addDisposableResource,
|
|
595
|
-
__disposeResources
|
|
609
|
+
__disposeResources,
|
|
610
|
+
__rewriteRelativeImportExtension
|
|
596
611
|
};
|
|
597
612
|
}
|
|
598
613
|
});
|
|
@@ -6,7 +6,7 @@ const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FWAX6DIR.js";
|
|
10
10
|
|
|
11
11
|
// src/createBlobStorageUrl.ts
|
|
12
12
|
function createBlobStorageUrl(storageAccount) {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
init_tslib_es6,
|
|
13
13
|
require_commonjs,
|
|
14
14
|
tslib_es6_exports
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FWAX6DIR.js";
|
|
16
16
|
|
|
17
17
|
// ../../node_modules/.store/@azure-abort-controller-npm-2.1.2-a36d73ebb9/package/dist/commonjs/AbortError.js
|
|
18
18
|
var require_AbortError = __commonJS({
|
|
@@ -2030,9 +2030,9 @@ var require_package = __commonJS({
|
|
|
2030
2030
|
}
|
|
2031
2031
|
});
|
|
2032
2032
|
|
|
2033
|
-
// ../../node_modules/.store/debug-virtual-
|
|
2033
|
+
// ../../node_modules/.store/debug-virtual-45decf707a/package/src/common.js
|
|
2034
2034
|
var require_common = __commonJS({
|
|
2035
|
-
"../../node_modules/.store/debug-virtual-
|
|
2035
|
+
"../../node_modules/.store/debug-virtual-45decf707a/package/src/common.js"(exports, module) {
|
|
2036
2036
|
function setup(env) {
|
|
2037
2037
|
createDebug.debug = createDebug;
|
|
2038
2038
|
createDebug.default = createDebug;
|
|
@@ -2204,9 +2204,9 @@ var require_common = __commonJS({
|
|
|
2204
2204
|
}
|
|
2205
2205
|
});
|
|
2206
2206
|
|
|
2207
|
-
// ../../node_modules/.store/debug-virtual-
|
|
2207
|
+
// ../../node_modules/.store/debug-virtual-45decf707a/package/src/browser.js
|
|
2208
2208
|
var require_browser = __commonJS({
|
|
2209
|
-
"../../node_modules/.store/debug-virtual-
|
|
2209
|
+
"../../node_modules/.store/debug-virtual-45decf707a/package/src/browser.js"(exports, module) {
|
|
2210
2210
|
exports.formatArgs = formatArgs;
|
|
2211
2211
|
exports.save = save;
|
|
2212
2212
|
exports.load = load;
|
|
@@ -2510,9 +2510,9 @@ var require_package3 = __commonJS({
|
|
|
2510
2510
|
}
|
|
2511
2511
|
});
|
|
2512
2512
|
|
|
2513
|
-
// ../../node_modules/.store/debug-virtual-
|
|
2513
|
+
// ../../node_modules/.store/debug-virtual-45decf707a/package/src/node.js
|
|
2514
2514
|
var require_node = __commonJS({
|
|
2515
|
-
"../../node_modules/.store/debug-virtual-
|
|
2515
|
+
"../../node_modules/.store/debug-virtual-45decf707a/package/src/node.js"(exports, module) {
|
|
2516
2516
|
var tty = __require("tty");
|
|
2517
2517
|
var util = __require("util");
|
|
2518
2518
|
exports.init = init;
|
|
@@ -2691,9 +2691,9 @@ var require_node = __commonJS({
|
|
|
2691
2691
|
}
|
|
2692
2692
|
});
|
|
2693
2693
|
|
|
2694
|
-
// ../../node_modules/.store/debug-virtual-
|
|
2694
|
+
// ../../node_modules/.store/debug-virtual-45decf707a/package/src/index.js
|
|
2695
2695
|
var require_src = __commonJS({
|
|
2696
|
-
"../../node_modules/.store/debug-virtual-
|
|
2696
|
+
"../../node_modules/.store/debug-virtual-45decf707a/package/src/index.js"(exports, module) {
|
|
2697
2697
|
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
2698
2698
|
module.exports = require_browser();
|
|
2699
2699
|
} else {
|
|
@@ -6,14 +6,14 @@ const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
require_package as require_package2
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-J2GVYUBP.js";
|
|
10
10
|
import {
|
|
11
11
|
require_commonjs2,
|
|
12
12
|
require_commonjs3,
|
|
13
13
|
require_commonjs4,
|
|
14
14
|
require_commonjs5,
|
|
15
15
|
require_package
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YJE37DFQ.js";
|
|
17
17
|
import {
|
|
18
18
|
__commonJS,
|
|
19
19
|
__esm,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
__toCommonJS,
|
|
24
24
|
__toESM,
|
|
25
25
|
require_commonjs
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FWAX6DIR.js";
|
|
27
27
|
|
|
28
28
|
// ../../node_modules/.store/@azure-abort-controller-npm-1.1.0-5b4e309629/package/dist/index.js
|
|
29
29
|
var require_dist = __commonJS({
|
|
@@ -6,15 +6,15 @@ const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
createBlobStorageUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QZWJDZ4T.js";
|
|
10
10
|
import {
|
|
11
11
|
require_dist
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-FCLWQPWW.js";
|
|
13
|
+
import "./chunk-YJE37DFQ.js";
|
|
14
14
|
import {
|
|
15
15
|
__name,
|
|
16
16
|
__toESM
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FWAX6DIR.js";
|
|
18
18
|
|
|
19
19
|
// src/getListOfBlobs.ts
|
|
20
20
|
var import_storage_blob = __toESM(require_dist(), 1);
|
|
@@ -22,8 +22,10 @@ async function getListOfBlobs({ container, storageAccount, credential }) {
|
|
|
22
22
|
const blobStorageClient = new import_storage_blob.BlobServiceClient(createBlobStorageUrl(storageAccount), credential);
|
|
23
23
|
const containerClient = blobStorageClient.getContainerClient(container);
|
|
24
24
|
const blobs = /* @__PURE__ */ new Set();
|
|
25
|
-
for await (const blob of containerClient.
|
|
26
|
-
|
|
25
|
+
for await (const blob of containerClient.listBlobsByHierarchy("/")) {
|
|
26
|
+
if (blob.kind === "blob") {
|
|
27
|
+
blobs.add(blob.name);
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
30
|
return blobs;
|
|
29
31
|
}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const __dirname = topLevelPath.dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
__name,
|
|
9
9
|
require_commonjs
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FWAX6DIR.js";
|
|
11
11
|
|
|
12
12
|
// src/registerAzureLogger.ts
|
|
13
13
|
import EventEmitter from "events";
|
|
@@ -96,10 +96,10 @@ async function createRemoteCacheClient(params) {
|
|
|
96
96
|
const azureLogEventHandler = registerAzureLogger();
|
|
97
97
|
const { context, options } = params;
|
|
98
98
|
const { container, loginMethod, storageAccount, cachePath, tenantId } = options;
|
|
99
|
-
const { getCredential } = await import("./getCredential-
|
|
100
|
-
const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-
|
|
101
|
-
const { ReporterDecorator } = await import("./ReporterDecorator-
|
|
102
|
-
const { getListOfBlobs } = await import("./getListOfBlobs-
|
|
99
|
+
const { getCredential } = await import("./getCredential-HAVZEKRP.js");
|
|
100
|
+
const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-MGVQID6U.js");
|
|
101
|
+
const { ReporterDecorator } = await import("./ReporterDecorator-GABX72QZ.js");
|
|
102
|
+
const { getListOfBlobs } = await import("./getListOfBlobs-S2XCR2P4.js");
|
|
103
103
|
const credential = await getCredential(
|
|
104
104
|
{ loginMethod, cachePath, tenantId },
|
|
105
105
|
{ ...context, azureLogger: azureLogEventHandler }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';
|
|
2
1
|
import type { RemoteCacheClient, RemoteCacheClientOperationOptions, RemoteCacheClientUploadOperationOptions } from './types/RemoteCacheClient.js';
|
|
2
|
+
import type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';
|
|
3
3
|
export declare class AzureRemoteCacheClient implements RemoteCacheClient {
|
|
4
4
|
private readonly logger;
|
|
5
5
|
private readonly config;
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(remoteCacheClientOptions: RemoteCacheClientOptions);
|
|
7
7
|
/**
|
|
8
8
|
* Uploads the folder to the remote cache.
|
|
9
9
|
* @param id - The unique identifier of the asset to upload.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';
|
|
2
|
+
import type { CustomStorageConfig } from 'backfill-config';
|
|
3
|
+
export declare function createCacheStorageConfig(remoteCacheClientOptions: RemoteCacheClientOptions): CustomStorageConfig;
|
|
4
|
+
//# sourceMappingURL=createCacheStorageConfig.d.ts.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createRemoteCacheClient, type CreateRemoteCacheClientParams } from './createRemoteCacheClient.js';
|
|
2
|
-
export type { RemoteCacheClient, RemoteCacheClientUploadOperationOptions
|
|
2
|
+
export type { RemoteCacheClient, RemoteCacheClientUploadOperationOptions, RemoteCacheClientOperationOptions, RemoteCacheClientOperationResult, } from './types/RemoteCacheClient.js';
|
|
3
3
|
export type { LoginMethod } from './types/LoginMethod.js';
|
|
4
4
|
export type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';
|
|
5
5
|
//# 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.9.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",
|
|
@@ -27,11 +27,12 @@
|
|
|
27
27
|
"lib/**/*.d.ts"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@ms-cloudpack/common-types": "^0.23.
|
|
30
|
+
"@ms-cloudpack/common-types": "^0.23.1",
|
|
31
31
|
"@ms-cloudpack/retry": "^0.1.2",
|
|
32
32
|
"@ms-cloudpack/task-reporter": "^0.14.5",
|
|
33
33
|
"@ms-cloudpack/telemetry": "^0.6.3",
|
|
34
34
|
"@napi-rs/keyring": "^1.0.0",
|
|
35
|
+
"mime-types": "^2.0.0",
|
|
35
36
|
"node-dpapi-prebuilt": "^1.0.3"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
@@ -42,7 +43,10 @@
|
|
|
42
43
|
"@azure/storage-blob": "^12.17.0",
|
|
43
44
|
"@ms-cloudpack/eslint-plugin-internal": "*",
|
|
44
45
|
"@ms-cloudpack/scripts": "*",
|
|
46
|
+
"@types/mime-types": "^2.0.0",
|
|
45
47
|
"backfill": "^6.2.1",
|
|
46
|
-
"backfill-
|
|
48
|
+
"backfill-cache": "^5.8.1",
|
|
49
|
+
"backfill-config": "^6.4.1",
|
|
50
|
+
"backfill-logger": "^5.2.1"
|
|
47
51
|
}
|
|
48
52
|
}
|