@ms-cloudpack/remote-cache 0.11.75 → 0.11.77

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.
@@ -8,7 +8,7 @@ const __filename = topLevelUrl.fileURLToPath(import.meta.url);
8
8
  const __dirname = topLevelPath.dirname(__filename);
9
9
  import {
10
10
  __name
11
- } from "./chunk-G5MAFA37.js";
11
+ } from "./chunk-GKUS2JGY.js";
12
12
 
13
13
  // src/getListOfBlobs.ts
14
14
  async function getListOfBlobs(containerClient, context) {
package/dist/index.js CHANGED
@@ -34,16 +34,16 @@ import {
34
34
  serializationPolicy,
35
35
  serializationPolicyName,
36
36
  stringifyXML
37
- } from "./chunk-IW2GFJHQ.js";
37
+ } from "./chunk-DTZKESCD.js";
38
38
  import {
39
39
  require_commonjs
40
- } from "./chunk-4NNZM6TT.js";
41
- import "./chunk-7NTERDBN.js";
42
- import "./chunk-HL7BG7JS.js";
40
+ } from "./chunk-MIWDHAQF.js";
41
+ import "./chunk-BOUMQX3J.js";
42
+ import "./chunk-HONSOHFT.js";
43
43
  import {
44
44
  __export,
45
45
  __name
46
- } from "./chunk-G5MAFA37.js";
46
+ } from "./chunk-GKUS2JGY.js";
47
47
 
48
48
  // src/registerAzureLogger.ts
49
49
  import EventEmitter from "events";
@@ -62,7 +62,10 @@ function registerAzureLogger() {
62
62
  __name(registerAzureLogger, "registerAzureLogger");
63
63
 
64
64
  // src/decorators/InMemoryDecorator.ts
65
- var _InMemoryDecorator = class _InMemoryDecorator {
65
+ var InMemoryDecorator = class {
66
+ static {
67
+ __name(this, "InMemoryDecorator");
68
+ }
66
69
  cacheClient;
67
70
  list;
68
71
  constructor(options) {
@@ -86,11 +89,12 @@ var _InMemoryDecorator = class _InMemoryDecorator {
86
89
  return this.cacheClient.downloadFolder(options);
87
90
  }
88
91
  };
89
- __name(_InMemoryDecorator, "InMemoryDecorator");
90
- var InMemoryDecorator = _InMemoryDecorator;
91
92
 
92
93
  // src/decorators/RetryDecorator.ts
93
- var _RetryDecorator = class _RetryDecorator {
94
+ var RetryDecorator = class {
95
+ static {
96
+ __name(this, "RetryDecorator");
97
+ }
94
98
  cacheClient;
95
99
  retryManager;
96
100
  constructor(options) {
@@ -98,10 +102,9 @@ var _RetryDecorator = class _RetryDecorator {
98
102
  this.retryManager = options.retryManager;
99
103
  }
100
104
  printRetryContext(operationName, options, retryContext) {
101
- var _a;
102
105
  if (retryContext.retryAttempt > 0) {
103
106
  console.warn(
104
- `Retrying ${operationName} ${options.friendlyName} ... [${retryContext.retryAttempt}/${(_a = retryContext.policy) == null ? void 0 : _a.maxRetries}]`
107
+ `Retrying ${operationName} ${options.friendlyName} ... [${retryContext.retryAttempt}/${retryContext.policy?.maxRetries}]`
105
108
  );
106
109
  }
107
110
  }
@@ -118,8 +121,6 @@ var _RetryDecorator = class _RetryDecorator {
118
121
  });
119
122
  }
120
123
  };
121
- __name(_RetryDecorator, "RetryDecorator");
122
- var RetryDecorator = _RetryDecorator;
123
124
 
124
125
  // src/retry/blockListIsInvalidRetryPolicy.ts
125
126
  var blockListIsInvalidRetryPolicy = {
@@ -151,10 +152,10 @@ async function createRemoteCacheClient(params) {
151
152
  const { container, loginMethod, storageAccount, cachePath, tenantId } = options;
152
153
  const { telemetryClient } = context;
153
154
  return telemetryClient.tracer.startActiveSpan("CREATE_REMOTE_CACHE_CLIENT", async () => {
154
- const { getCredential } = await import("./getCredential-ZFTRCRNY.js");
155
- const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-MLQBWB3M.js");
156
- const { ReporterDecorator } = await import("./ReporterDecorator-ZL5AFS6T.js");
157
- const { getListOfBlobs } = await import("./getListOfBlobs-USCOZRLX.js");
155
+ const { getCredential } = await import("./getCredential-Y4HWJOQE.js");
156
+ const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-S57Z5QDW.js");
157
+ const { ReporterDecorator } = await import("./ReporterDecorator-DNRF2TDF.js");
158
+ const { getListOfBlobs } = await import("./getListOfBlobs-EKSDNQNV.js");
158
159
  const credential = await getCredential(
159
160
  { loginMethod, cachePath, tenantId },
160
161
  { ...context, azureLogger: azureLogEventHandler }
@@ -2057,7 +2058,10 @@ var comp2 = {
2057
2058
  };
2058
2059
 
2059
2060
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/generated/operations/table.js
2060
- var _TableImpl = class _TableImpl {
2061
+ var TableImpl = class {
2062
+ static {
2063
+ __name(this, "TableImpl");
2064
+ }
2061
2065
  client;
2062
2066
  /**
2063
2067
  * Initialize a new instance of the class Table class.
@@ -2166,8 +2170,6 @@ var _TableImpl = class _TableImpl {
2166
2170
  return this.client.sendOperationRequest({ table: table2, options }, setAccessPolicyOperationSpec);
2167
2171
  }
2168
2172
  };
2169
- __name(_TableImpl, "TableImpl");
2170
- var TableImpl = _TableImpl;
2171
2173
  var xmlSerializer = createSerializer(
2172
2174
  mappers_exports,
2173
2175
  /* isXml */
@@ -2508,7 +2510,10 @@ var setAccessPolicyOperationSpec = {
2508
2510
 
2509
2511
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/generated/operations/service.js
2510
2512
  init_esm6();
2511
- var _ServiceImpl = class _ServiceImpl {
2513
+ var ServiceImpl = class {
2514
+ static {
2515
+ __name(this, "ServiceImpl");
2516
+ }
2512
2517
  client;
2513
2518
  /**
2514
2519
  * Initialize a new instance of the class Service class.
@@ -2543,8 +2548,6 @@ var _ServiceImpl = class _ServiceImpl {
2543
2548
  return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec);
2544
2549
  }
2545
2550
  };
2546
- __name(_ServiceImpl, "ServiceImpl");
2547
- var ServiceImpl = _ServiceImpl;
2548
2551
  var xmlSerializer2 = createSerializer(
2549
2552
  mappers_exports,
2550
2553
  /* isXml */
@@ -2624,7 +2627,10 @@ var getStatisticsOperationSpec = {
2624
2627
  };
2625
2628
 
2626
2629
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/generated/generatedClient.js
2627
- var _GeneratedClient = class _GeneratedClient extends ServiceClient {
2630
+ var GeneratedClient = class extends ServiceClient {
2631
+ static {
2632
+ __name(this, "GeneratedClient");
2633
+ }
2628
2634
  url;
2629
2635
  version;
2630
2636
  /**
@@ -2661,8 +2667,6 @@ var _GeneratedClient = class _GeneratedClient extends ServiceClient {
2661
2667
  table;
2662
2668
  service;
2663
2669
  };
2664
- __name(_GeneratedClient, "GeneratedClient");
2665
- var GeneratedClient = _GeneratedClient;
2666
2670
 
2667
2671
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/utils/apiVersionPolicy.js
2668
2672
  var apiVersionPolicyName = "apiVersionPolicy";
@@ -2807,10 +2811,9 @@ __name(getAccountNameFromUrl, "getAccountNameFromUrl");
2807
2811
 
2808
2812
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/utils/errorHelpers.js
2809
2813
  function handleTableAlreadyExists(error, options = {}) {
2810
- var _a, _b;
2811
2814
  const responseError = getErrorResponse(error);
2812
- if (responseError && responseError.status === 409 && ((_a = responseError.parsedBody.odataError) == null ? void 0 : _a.code) === "TableAlreadyExists") {
2813
- (_b = options.logger) == null ? void 0 : _b.info(`Table ${options.tableName} already Exists`);
2815
+ if (responseError && responseError.status === 409 && responseError.parsedBody.odataError?.code === "TableAlreadyExists") {
2816
+ options.logger?.info(`Table ${options.tableName} already Exists`);
2814
2817
  if (options.onResponse) {
2815
2818
  options.onResponse(responseError, {});
2816
2819
  }
@@ -2835,7 +2838,7 @@ function isRestError(error) {
2835
2838
  }
2836
2839
  __name(isRestError, "isRestError");
2837
2840
  function isTableServiceErrorResponse(errorResponseBody) {
2838
- return Boolean(errorResponseBody == null ? void 0 : errorResponseBody.odataError);
2841
+ return Boolean(errorResponseBody?.odataError);
2839
2842
  }
2840
2843
  __name(isTableServiceErrorResponse, "isTableServiceErrorResponse");
2841
2844
 
@@ -2953,7 +2956,6 @@ var tracingClient = createTracingClient({
2953
2956
 
2954
2957
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/utils/isCosmosEndpoint.js
2955
2958
  function isCosmosEndpoint(url2) {
2956
- var _a, _b, _c;
2957
2959
  const parsedURL = new URL(url2);
2958
2960
  if (parsedURL.hostname.indexOf(".table.cosmosdb.") !== -1) {
2959
2961
  return true;
@@ -2964,8 +2966,8 @@ function isCosmosEndpoint(url2) {
2964
2966
  if ((parsedURL.hostname === "localhost" || parsedURL.hostname === "127.0.0.1") && parsedURL.pathname.startsWith("/devstoreaccount1")) {
2965
2967
  return false;
2966
2968
  }
2967
- const azuriteAccounts = (_c = (_b = (_a = globalThis.process) == null ? void 0 : _a.env) == null ? void 0 : _b.AZURITE_ACCOUNTS) == null ? void 0 : _c.split(":");
2968
- if ((azuriteAccounts == null ? void 0 : azuriteAccounts[0]) && parsedURL.hostname.includes(azuriteAccounts[0])) {
2969
+ const azuriteAccounts = globalThis.process?.env?.AZURITE_ACCOUNTS?.split(":");
2970
+ if (azuriteAccounts?.[0] && parsedURL.hostname.includes(azuriteAccounts[0])) {
2969
2971
  return false;
2970
2972
  }
2971
2973
  if (parsedURL.hostname === "localhost") {
@@ -3106,7 +3108,10 @@ function getTransactionHeaders(transactionGuid) {
3106
3108
  __name(getTransactionHeaders, "getTransactionHeaders");
3107
3109
 
3108
3110
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/TableTransaction.js
3109
- var _InternalTableTransaction = class _InternalTableTransaction {
3111
+ var InternalTableTransaction = class {
3112
+ static {
3113
+ __name(this, "InternalTableTransaction");
3114
+ }
3110
3115
  /**
3111
3116
  * Table Account URL
3112
3117
  */
@@ -3231,8 +3236,6 @@ var _InternalTableTransaction = class _InternalTableTransaction {
3231
3236
  return this.url.endsWith("/") ? this.url : `${this.url}/`;
3232
3237
  }
3233
3238
  };
3234
- __name(_InternalTableTransaction, "InternalTableTransaction");
3235
- var InternalTableTransaction = _InternalTableTransaction;
3236
3239
  function parseTransactionResponse(transactionResponse) {
3237
3240
  const subResponsePrefix = `--changesetresponse_`;
3238
3241
  const status = transactionResponse.status;
@@ -3245,7 +3248,7 @@ function parseTransactionResponse(transactionResponse) {
3245
3248
  const subResponses = splitBody.slice(1, splitBody.length - 1);
3246
3249
  const responses = subResponses.map((subResponse) => {
3247
3250
  const statusMatch = subResponse.match(/HTTP\/1.1 ([0-9]*)/);
3248
- if ((statusMatch == null ? void 0 : statusMatch.length) !== 2) {
3251
+ if (statusMatch?.length !== 2) {
3249
3252
  throw new Error(`Couldn't extract status from sub-response:
3250
3253
  ${subResponse}`);
3251
3254
  }
@@ -3254,15 +3257,15 @@ function parseTransactionResponse(transactionResponse) {
3254
3257
  throw new Error(`Expected sub-response status to be an integer ${subResponseStatus}`);
3255
3258
  }
3256
3259
  const bodyMatch = subResponse.match(/\{(.*)\}/);
3257
- if ((bodyMatch == null ? void 0 : bodyMatch.length) === 2) {
3260
+ if (bodyMatch?.length === 2) {
3258
3261
  handleBodyError(bodyMatch[0], subResponseStatus, transactionResponse.request, transactionResponse);
3259
3262
  }
3260
3263
  const etagMatch = subResponse.match(/ETag: (.*)/);
3261
3264
  const rowKeyMatch = subResponse.match(/RowKey='(.*)'/);
3262
3265
  return {
3263
3266
  status: subResponseStatus,
3264
- ...(rowKeyMatch == null ? void 0 : rowKeyMatch.length) === 2 && { rowKey: rowKeyMatch[1] },
3265
- ...(etagMatch == null ? void 0 : etagMatch.length) === 2 && { etag: etagMatch[1] }
3267
+ ...rowKeyMatch?.length === 2 && { rowKey: rowKeyMatch[1] },
3268
+ ...etagMatch?.length === 2 && { etag: etagMatch[1] }
3266
3269
  };
3267
3270
  });
3268
3271
  return {
@@ -3273,7 +3276,6 @@ function parseTransactionResponse(transactionResponse) {
3273
3276
  }
3274
3277
  __name(parseTransactionResponse, "parseTransactionResponse");
3275
3278
  function handleBodyError(bodyAsText, statusCode, request, response) {
3276
- var _a;
3277
3279
  let parsedError;
3278
3280
  try {
3279
3281
  parsedError = JSON.parse(bodyAsText);
@@ -3284,7 +3286,7 @@ function handleBodyError(bodyAsText, statusCode, request, response) {
3284
3286
  let code;
3285
3287
  if (parsedError && parsedError["odata.error"]) {
3286
3288
  const error = parsedError["odata.error"];
3287
- message = ((_a = error.message) == null ? void 0 : _a.value) ?? message;
3289
+ message = error.message?.value ?? message;
3288
3290
  code = error.code;
3289
3291
  }
3290
3292
  throw new RestError(message, {
@@ -3404,7 +3406,7 @@ function serializeObject(obj) {
3404
3406
  }
3405
3407
  __name(serializeObject, "serializeObject");
3406
3408
  function getSerializedValue(value) {
3407
- if (typeof value === "object" && (value == null ? void 0 : value.value) !== void 0 && (value == null ? void 0 : value.type) !== void 0) {
3409
+ if (typeof value === "object" && value?.value !== void 0 && value?.type !== void 0) {
3408
3410
  return serializeObject(value);
3409
3411
  } else {
3410
3412
  return serializePrimitive(value);
@@ -3561,13 +3563,14 @@ init_esm7();
3561
3563
 
3562
3564
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/utils/uuid.js
3563
3565
  init_esm2();
3564
- var _Uuid = class _Uuid {
3566
+ var Uuid = class {
3567
+ static {
3568
+ __name(this, "Uuid");
3569
+ }
3565
3570
  static generateUuid() {
3566
3571
  return randomUUID();
3567
3572
  }
3568
3573
  };
3569
- __name(_Uuid, "Uuid");
3570
- var Uuid = _Uuid;
3571
3574
 
3572
3575
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/odata.js
3573
3576
  function escapeQuotes(input) {
@@ -3576,7 +3579,10 @@ function escapeQuotes(input) {
3576
3579
  __name(escapeQuotes, "escapeQuotes");
3577
3580
 
3578
3581
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/TableClient.js
3579
- var _TableClient = class _TableClient {
3582
+ var TableClient = class _TableClient {
3583
+ static {
3584
+ __name(this, "TableClient");
3585
+ }
3580
3586
  /**
3581
3587
  * Table Account URL
3582
3588
  */
@@ -3782,9 +3788,9 @@ var _TableClient = class _TableClient {
3782
3788
  byPage: /* @__PURE__ */ __name((settings) => {
3783
3789
  const pageOptions = {
3784
3790
  ...options,
3785
- queryOptions: { ...options.queryOptions, top: settings == null ? void 0 : settings.maxPageSize }
3791
+ queryOptions: { ...options.queryOptions, top: settings?.maxPageSize }
3786
3792
  };
3787
- if (settings == null ? void 0 : settings.continuationToken) {
3793
+ if (settings?.continuationToken) {
3788
3794
  pageOptions.continuationToken = settings.continuationToken;
3789
3795
  }
3790
3796
  return this.listEntitiesPage(tableName, pageOptions);
@@ -4163,8 +4169,6 @@ var _TableClient = class _TableClient {
4163
4169
  }
4164
4170
  }
4165
4171
  };
4166
- __name(_TableClient, "TableClient");
4167
- var TableClient = _TableClient;
4168
4172
 
4169
4173
  // ../../node_modules/.store/@azure-data-tables-npm-13.3.2-5bd51024a0/package/dist/esm/index.js
4170
4174
  init_esm5();
@@ -4200,13 +4204,18 @@ function getReverseSortedTimestamp() {
4200
4204
  __name(getReverseSortedTimestamp, "getReverseSortedTimestamp");
4201
4205
 
4202
4206
  // src/AzureAppRegistryClient.ts
4203
- var _AzureAppRegistryClient = class _AzureAppRegistryClient {
4207
+ var AzureAppRegistryClient = class {
4204
4208
  constructor(storageUrl, credential) {
4205
4209
  this.storageUrl = storageUrl;
4206
4210
  this.credential = credential;
4207
4211
  this.appsTableClient = new TableClient(storageUrl, "apps", credential);
4208
4212
  this.appVersionsTableClient = new TableClient(storageUrl, "appVersions", credential);
4209
4213
  }
4214
+ storageUrl;
4215
+ credential;
4216
+ static {
4217
+ __name(this, "AzureAppRegistryClient");
4218
+ }
4210
4219
  appsTableClient;
4211
4220
  appVersionsTableClient;
4212
4221
  /**
@@ -4284,8 +4293,6 @@ var _AzureAppRegistryClient = class _AzureAppRegistryClient {
4284
4293
  };
4285
4294
  }
4286
4295
  };
4287
- __name(_AzureAppRegistryClient, "AzureAppRegistryClient");
4288
- var AzureAppRegistryClient = _AzureAppRegistryClient;
4289
4296
 
4290
4297
  // src/createAppRegistryClient.ts
4291
4298
  var defaultTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47";
@@ -4294,7 +4301,7 @@ async function createAppRegistryClient(params) {
4294
4301
  const { context, options } = params;
4295
4302
  const { loginMethod, cachePath, tenantId = defaultTenantId, storageAccount = defaultStorageAccount } = options;
4296
4303
  const azureLogEventHandler = registerAzureLogger();
4297
- const { getCredential } = await import("./getCredential-ZFTRCRNY.js");
4304
+ const { getCredential } = await import("./getCredential-Y4HWJOQE.js");
4298
4305
  const credential = await getCredential(
4299
4306
  { loginMethod, cachePath, tenantId },
4300
4307
  { ...context, azureLogger: azureLogEventHandler }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/remote-cache",
3
- "version": "0.11.75",
3
+ "version": "0.11.77",
4
4
  "description": "Manages syncing the local Cloudpack cached assets to/from a remote storage service.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,11 +23,11 @@
23
23
  "test": "cloudpack-scripts test"
24
24
  },
25
25
  "dependencies": {
26
- "@ms-cloudpack/common-types": "^0.34.0",
27
- "@ms-cloudpack/environment": "^0.1.1",
28
- "@ms-cloudpack/retry": "^0.1.3",
29
- "@ms-cloudpack/task-reporter": "^0.21.0",
30
- "@ms-cloudpack/telemetry": "^0.11.75",
26
+ "@ms-cloudpack/common-types": "^0.34.2",
27
+ "@ms-cloudpack/environment": "^0.1.4",
28
+ "@ms-cloudpack/retry": "^0.1.5",
29
+ "@ms-cloudpack/task-reporter": "^0.21.2",
30
+ "@ms-cloudpack/telemetry": "^0.12.1",
31
31
  "@napi-rs/keyring": "1.2.0",
32
32
  "mime-types": "^3.0.0",
33
33
  "node-dpapi-prebuilt": "^1.0.3"