@ms-cloudpack/remote-cache 0.10.23 → 0.11.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.
Files changed (39) hide show
  1. package/dist/{AzureRemoteCacheClient-UFUB2BJI.js → AzureRemoteCacheClient-RQPQQPU4.js} +187 -129
  2. package/dist/{chunk-JNKRKLGF.js → chunk-XND2VV4N.js} +7796 -217
  3. package/dist/index.js +19 -45
  4. package/lib/AzureAppRegistryClient.d.ts +1 -1
  5. package/lib/createAppRegistryClient.d.ts +1 -1
  6. package/lib/createRemoteCacheClient.d.ts +1 -1
  7. package/lib/index.d.ts +0 -1
  8. package/package.json +3 -9
  9. package/dist/chunk-LEHUXQFL.js +0 -7606
  10. package/dist/chunk-N4V3CONX.js +0 -80
  11. package/dist/getCredential-EQJXGMRZ.js +0 -20878
  12. package/lib/authentication/forks/identity-cache-persistence/cachePersistencePlugin.d.ts +0 -34
  13. package/lib/authentication/forks/identity-cache-persistence/platforms.d.ts +0 -50
  14. package/lib/authentication/forks/identity-cache-persistence/provider.d.ts +0 -17
  15. package/lib/authentication/forks/msal-node-extensions/error/PersistenceError.d.ts +0 -37
  16. package/lib/authentication/forks/msal-node-extensions/lock/CrossPlatformLock.d.ts +0 -25
  17. package/lib/authentication/forks/msal-node-extensions/lock/CrossPlatformLockOptions.d.ts +0 -16
  18. package/lib/authentication/forks/msal-node-extensions/persistence/BasePersistence.d.ts +0 -6
  19. package/lib/authentication/forks/msal-node-extensions/persistence/FilePersistence.d.ts +0 -31
  20. package/lib/authentication/forks/msal-node-extensions/persistence/FilePersistenceWithDataProtection.d.ts +0 -30
  21. package/lib/authentication/forks/msal-node-extensions/persistence/IPersistence.d.ts +0 -17
  22. package/lib/authentication/forks/msal-node-extensions/persistence/IPersistenceConfiguration.d.ts +0 -16
  23. package/lib/authentication/forks/msal-node-extensions/persistence/NapiRsKeyRingPersistence.d.ts +0 -19
  24. package/lib/authentication/forks/msal-node-extensions/persistence/PersistenceCachePlugin.d.ts +0 -35
  25. package/lib/authentication/forks/msal-node-extensions/utils/Constants.d.ts +0 -44
  26. package/lib/authentication/forks/msal-node-extensions/utils/TypeGuards.d.ts +0 -10
  27. package/lib/authentication/getAuthenticationRecord.d.ts +0 -8
  28. package/lib/authentication/getAuthenticationRecordPath.d.ts +0 -7
  29. package/lib/authentication/getCredential.d.ts +0 -21
  30. package/lib/authentication/lock-file/deleteAuthenticationLockFile.d.ts +0 -7
  31. package/lib/authentication/lock-file/doesLockFileExist.d.ts +0 -6
  32. package/lib/authentication/lock-file/getAuthenticationLockFilePath.d.ts +0 -19
  33. package/lib/authentication/lock-file/readAuthenticationLockFile.d.ts +0 -6
  34. package/lib/authentication/lock-file/tryCleaningLockFile.d.ts +0 -6
  35. package/lib/authentication/saveAuthenticationRecord.d.ts +0 -9
  36. package/lib/authentication/tokenCachePersistenceOptions.d.ts +0 -9
  37. package/lib/registerAzureLogger.d.ts +0 -6
  38. package/lib/types/LoginMethod.d.ts +0 -2
  39. package/lib/utils/isProcessRunning.d.ts +0 -7
package/dist/index.js CHANGED
@@ -4,20 +4,18 @@ 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_commonjs5,
9
- require_commonjs2 as require_commonjs7,
10
- require_dist
11
- } from "./chunk-JNKRKLGF.js";
12
7
  import {
13
8
  init_tslib_es6,
14
9
  require_commonjs,
15
- require_commonjs3 as require_commonjs2,
16
- require_commonjs4 as require_commonjs3,
17
- require_commonjs5 as require_commonjs4,
10
+ require_commonjs2,
11
+ require_commonjs3,
12
+ require_commonjs4,
13
+ require_commonjs5,
18
14
  require_commonjs6,
15
+ require_commonjs7,
16
+ require_dist,
19
17
  tslib_es6_exports
20
- } from "./chunk-LEHUXQFL.js";
18
+ } from "./chunk-XND2VV4N.js";
21
19
  import {
22
20
  __commonJS,
23
21
  __name,
@@ -3211,7 +3209,7 @@ var require_dist2 = __commonJS({
3211
3209
  return coreAuth.isSASCredential(credential) || coreAuth.isNamedKeyCredential(credential) || coreAuth.isTokenCredential(credential);
3212
3210
  }
3213
3211
  __name(isCredential, "isCredential");
3214
- var logger2 = logger$1.createClientLogger("data-tables");
3212
+ var logger = logger$1.createClientLogger("data-tables");
3215
3213
  function setTokenChallengeAuthenticationPolicy(pipeline, credential, scopes) {
3216
3214
  pipeline.removePolicy({ name: "bearerTokenPolicy" });
3217
3215
  pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
@@ -3323,7 +3321,7 @@ var require_dist2 = __commonJS({
3323
3321
  const credential = isCredential(credentialOrOptions) ? credentialOrOptions : void 0;
3324
3322
  const clientOptions = (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};
3325
3323
  const internalPipelineOptions = Object.assign(Object.assign({}, clientOptions), { endpoint: clientOptions.endpoint || this.url, loggingOptions: {
3326
- logger: logger2.info,
3324
+ logger: logger.info,
3327
3325
  additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames]
3328
3326
  }, deserializationOptions: {
3329
3327
  parseXML: coreXml.parseXML
@@ -3386,7 +3384,7 @@ var require_dist2 = __commonJS({
3386
3384
  try {
3387
3385
  await this.table.create({ name }, updatedOptions);
3388
3386
  } catch (e) {
3389
- handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger: logger2, tableName: name }));
3387
+ handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger, tableName: name }));
3390
3388
  }
3391
3389
  });
3392
3390
  }
@@ -3402,7 +3400,7 @@ var require_dist2 = __commonJS({
3402
3400
  await this.table.delete(name, updatedOptions);
3403
3401
  } catch (e) {
3404
3402
  if (e.statusCode === 404) {
3405
- logger2.info("TableServiceClient.deleteTable: Table doesn't exist");
3403
+ logger.info("TableServiceClient.deleteTable: Table doesn't exist");
3406
3404
  } else {
3407
3405
  throw e;
3408
3406
  }
@@ -4120,7 +4118,7 @@ var require_dist2 = __commonJS({
4120
4118
  this.clientOptions = (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};
4121
4119
  this.allowInsecureConnection = (_a = this.clientOptions.allowInsecureConnection) !== null && _a !== void 0 ? _a : false;
4122
4120
  const internalPipelineOptions = Object.assign(Object.assign({}, this.clientOptions), { endpoint: this.clientOptions.endpoint || this.url, loggingOptions: {
4123
- logger: logger2.info,
4121
+ logger: logger.info,
4124
4122
  additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames]
4125
4123
  }, deserializationOptions: {
4126
4124
  parseXML: coreXml.parseXML
@@ -4178,7 +4176,7 @@ var require_dist2 = __commonJS({
4178
4176
  await this.table.delete(this.tableName, updatedOptions);
4179
4177
  } catch (e) {
4180
4178
  if (e.statusCode === 404) {
4181
- logger2.info("TableClient.deleteTable: Table doesn't exist");
4179
+ logger.info("TableClient.deleteTable: Table doesn't exist");
4182
4180
  } else {
4183
4181
  throw e;
4184
4182
  }
@@ -4216,7 +4214,7 @@ var require_dist2 = __commonJS({
4216
4214
  try {
4217
4215
  await this.table.create({ name: this.tableName }, updatedOptions);
4218
4216
  } catch (e) {
4219
- handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger: logger2, tableName: this.tableName }));
4217
+ handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger, tableName: this.tableName }));
4220
4218
  }
4221
4219
  });
4222
4220
  }
@@ -4672,22 +4670,6 @@ var require_dist2 = __commonJS({
4672
4670
  }
4673
4671
  });
4674
4672
 
4675
- // src/registerAzureLogger.ts
4676
- import EventEmitter from "events";
4677
- var logger = require_commonjs();
4678
- function registerAzureLogger() {
4679
- const emitter = new EventEmitter();
4680
- logger.setLogLevel("verbose");
4681
- logger.AzureLogger.log = (...messages) => {
4682
- if (messages[0] === "azure:identity:verbose Node.js MSAL Open Browser =>" && messages[1].includes("Opening browser")) {
4683
- const url = messages[1].split(" ")[3];
4684
- emitter.emit("MsalBrowserOpen", url);
4685
- }
4686
- };
4687
- return emitter;
4688
- }
4689
- __name(registerAzureLogger, "registerAzureLogger");
4690
-
4691
4673
  // src/decorators/InMemoryDecorator.ts
4692
4674
  var _InMemoryDecorator = class _InMemoryDecorator {
4693
4675
  cacheClient;
@@ -4773,19 +4755,15 @@ __name(createTableStorageUrl, "createTableStorageUrl");
4773
4755
  // src/createRemoteCacheClient.ts
4774
4756
  var import_storage_blob = __toESM(require_dist(), 1);
4775
4757
  async function createRemoteCacheClient(params) {
4776
- const azureLogEventHandler = registerAzureLogger();
4777
4758
  const { context, options } = params;
4778
4759
  const { container, loginMethod, storageAccount, cachePath, tenantId } = options;
4779
4760
  const { telemetryClient } = context;
4780
4761
  return telemetryClient.tracer.startActiveSpan("CREATE_REMOTE_CACHE_CLIENT", async () => {
4781
- const { getCredential } = await import("./getCredential-EQJXGMRZ.js");
4782
- const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-UFUB2BJI.js");
4762
+ const { getCredential } = await import("@ms-cloudpack/auth");
4763
+ const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-RQPQQPU4.js");
4783
4764
  const { ReporterDecorator } = await import("./ReporterDecorator-VYNWC6CL.js");
4784
4765
  const { getListOfBlobs } = await import("./getListOfBlobs-BGP2V7PV.js");
4785
- const credential = await getCredential(
4786
- { loginMethod, cachePath, tenantId },
4787
- { ...context, azureLogger: azureLogEventHandler }
4788
- );
4766
+ const credential = await getCredential({ loginMethod, cachePath, tenantId }, context);
4789
4767
  const blobStorageClient = new import_storage_blob.BlobServiceClient(createBlobStorageUrl(storageAccount), credential);
4790
4768
  const containerClient = blobStorageClient.getContainerClient(container);
4791
4769
  const listOfBlobs = await getListOfBlobs(containerClient, context);
@@ -4930,12 +4908,8 @@ var defaultStorageAccount = "cloudpackstorage";
4930
4908
  async function createAppRegistryClient(params) {
4931
4909
  const { context, options } = params;
4932
4910
  const { loginMethod, cachePath, tenantId = defaultTenantId, storageAccount = defaultStorageAccount } = options;
4933
- const azureLogEventHandler = registerAzureLogger();
4934
- const { getCredential } = await import("./getCredential-EQJXGMRZ.js");
4935
- const credential = await getCredential(
4936
- { loginMethod, cachePath, tenantId },
4937
- { ...context, azureLogger: azureLogEventHandler }
4938
- );
4911
+ const { getCredential } = await import("@ms-cloudpack/auth");
4912
+ const credential = await getCredential({ loginMethod, cachePath, tenantId }, context);
4939
4913
  const url = createTableStorageUrl(storageAccount);
4940
4914
  const client = new AzureAppRegistryClient(url, credential);
4941
4915
  return client;
@@ -1,7 +1,7 @@
1
1
  import type { AppRegistration, AppRegistrationVersion } from './types/AppRegistration.js';
2
2
  import type { AppRegistryClient } from './types/AppRegistryClient.js';
3
3
  import type { PageSettings } from '@azure/core-paging';
4
- import type { TokenCredential } from '@azure/identity';
4
+ import type { TokenCredential } from '@ms-cloudpack/auth';
5
5
  import type { PagedResult } from './types/PagedResult.js';
6
6
  export declare class AzureAppRegistryClient implements AppRegistryClient {
7
7
  readonly storageUrl: string;
@@ -1,6 +1,6 @@
1
1
  import type { TaskReporter } from '@ms-cloudpack/task-reporter';
2
2
  import type { TelemetryClient } from '@ms-cloudpack/telemetry';
3
- import type { LoginMethod } from './types/LoginMethod.js';
3
+ import type { LoginMethod } from '@ms-cloudpack/auth';
4
4
  import type { RemoteCacheConfig } from '@ms-cloudpack/common-types';
5
5
  import type { AppRegistryClient } from './index.js';
6
6
  /**
@@ -2,7 +2,7 @@ import type { RemoteCacheConfig } from '@ms-cloudpack/common-types';
2
2
  import type { TaskReporter } from '@ms-cloudpack/task-reporter';
3
3
  import type { RemoteCacheClient } from './types/RemoteCacheClient.js';
4
4
  import type { TelemetryClient } from '@ms-cloudpack/telemetry';
5
- import type { LoginMethod } from './types/LoginMethod.js';
5
+ import type { LoginMethod } from '@ms-cloudpack/auth';
6
6
  export interface CreateRemoteCacheClientParams {
7
7
  options: RemoteCacheConfig & {
8
8
  loginMethod: LoginMethod;
package/lib/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export { createRemoteCacheClient, type CreateRemoteCacheClientParams } from './createRemoteCacheClient.js';
2
2
  export { createAppRegistryClient, type CreateAppRegistryClientParams } from './createAppRegistryClient.js';
3
3
  export type { RemoteCacheClient, RemoteCacheClientUploadOperationOptions, RemoteCacheClientOperationOptions, RemoteCacheClientOperationResult, } from './types/RemoteCacheClient.js';
4
- export type { LoginMethod } from './types/LoginMethod.js';
5
4
  export type { AppRegistration, AppRegistrationVersion } from './types/AppRegistration.js';
6
5
  export type { AppRegistryClient } from './types/AppRegistryClient.js';
7
6
  export type { PagedResult } from './types/PagedResult.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/remote-cache",
3
- "version": "0.10.23",
3
+ "version": "0.11.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",
@@ -27,22 +27,16 @@
27
27
  "lib/**/*.d.ts"
28
28
  ],
29
29
  "dependencies": {
30
+ "@ms-cloudpack/auth": "^0.1.1",
30
31
  "@ms-cloudpack/common-types": "^0.24.12",
31
- "@ms-cloudpack/environment": "^0.1.1",
32
32
  "@ms-cloudpack/retry": "^0.1.3",
33
33
  "@ms-cloudpack/task-reporter": "^0.16.0",
34
34
  "@ms-cloudpack/telemetry": "^0.11.5",
35
- "@napi-rs/keyring": "^1.0.0",
36
- "mime-types": "^2.0.0",
37
- "node-dpapi-prebuilt": "^1.0.3"
35
+ "mime-types": "^2.0.0"
38
36
  },
39
37
  "devDependencies": {
40
38
  "@azure/core-paging": "^1.0.0",
41
39
  "@azure/data-tables": "^13.0.0",
42
- "@azure/identity": "patch:@azure/identity@npm%3A4.3.0#~/.yarn/patches/@azure-identity-npm-4.3.0-e85334d38f.patch",
43
- "@azure/logger": "^1.0.0",
44
- "@azure/msal-common": "14.13.0",
45
- "@azure/msal-node": "2.11.0",
46
40
  "@azure/storage-blob": "^12.17.0",
47
41
  "@ms-cloudpack/eslint-plugin-internal": "*",
48
42
  "@ms-cloudpack/scripts": "*",