@ms-cloudpack/remote-cache 0.1.19 → 0.1.20

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 (31) hide show
  1. package/lib/authentication/acquireSasToken.d.ts +1 -1
  2. package/lib/authentication/acquireSasToken.d.ts.map +1 -1
  3. package/lib/authentication/acquireSasToken.js +2 -2
  4. package/lib/authentication/acquireSasToken.js.map +1 -1
  5. package/lib/authentication/getAuthenticatedConnectionString.d.ts.map +1 -1
  6. package/lib/authentication/getAuthenticatedConnectionString.js +1 -1
  7. package/lib/authentication/getAuthenticatedConnectionString.js.map +1 -1
  8. package/lib/authentication/getCredential.d.ts +3 -2
  9. package/lib/authentication/getCredential.d.ts.map +1 -1
  10. package/lib/authentication/getCredential.js +14 -7
  11. package/lib/authentication/getCredential.js.map +1 -1
  12. package/lib/createRemoteCacheClient.d.ts +5 -1
  13. package/lib/createRemoteCacheClient.d.ts.map +1 -1
  14. package/lib/createRemoteCacheClient.js +2 -2
  15. package/lib/createRemoteCacheClient.js.map +1 -1
  16. package/lib/decorators/ReporterDecorator.d.ts +6 -2
  17. package/lib/decorators/ReporterDecorator.d.ts.map +1 -1
  18. package/lib/decorators/ReporterDecorator.js +26 -4
  19. package/lib/decorators/ReporterDecorator.js.map +1 -1
  20. package/lib/index.d.ts +1 -0
  21. package/lib/index.d.ts.map +1 -1
  22. package/lib/index.js.map +1 -1
  23. package/lib/tsdoc-metadata.json +1 -1
  24. package/lib/types/ConnectionStringOptions.d.ts +2 -1
  25. package/lib/types/ConnectionStringOptions.d.ts.map +1 -1
  26. package/lib/types/ConnectionStringOptions.js.map +1 -1
  27. package/lib/types/LoginMethod.d.ts +2 -0
  28. package/lib/types/LoginMethod.d.ts.map +1 -0
  29. package/lib/types/LoginMethod.js +2 -0
  30. package/lib/types/LoginMethod.js.map +1 -0
  31. package/package.json +2 -1
@@ -1,3 +1,3 @@
1
1
  import type { ConnectionStringOptions } from '../types/ConnectionStringOptions.js';
2
- export declare function acquireSasToken({ storageAccount: account, container, permissions, isInteractiveLogin, tokenExpiresInMs, }: ConnectionStringOptions): Promise<string>;
2
+ export declare function acquireSasToken({ storageAccount: account, container, permissions, loginMethod, tokenExpiresInMs, }: ConnectionStringOptions): Promise<string>;
3
3
  //# sourceMappingURL=acquireSasToken.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"acquireSasToken.d.ts","sourceRoot":"","sources":["../../src/authentication/acquireSasToken.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAInF,wBAAsB,eAAe,CAAC,EACpC,cAAc,EAAE,OAAO,EACvB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,gBAAgB,GACjB,EAAE,uBAAuB,mBAgCzB"}
1
+ {"version":3,"file":"acquireSasToken.d.ts","sourceRoot":"","sources":["../../src/authentication/acquireSasToken.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAInF,wBAAsB,eAAe,CAAC,EACpC,cAAc,EAAE,OAAO,EACvB,SAAS,EACT,WAAW,EACX,WAAW,EACX,gBAAgB,GACjB,EAAE,uBAAuB,mBAgCzB"}
@@ -1,8 +1,8 @@
1
1
  import { BlobServiceClient, ContainerSASPermissions, SASProtocol, generateBlobSASQueryParameters, } from '@azure/storage-blob';
2
2
  import { createBlobStorageUrl } from './createBlobStorageUrl.js';
3
3
  import { getCredential } from './getCredential.js';
4
- export async function acquireSasToken({ storageAccount: account, container, permissions, isInteractiveLogin, tokenExpiresInMs, }) {
5
- const credential = getCredential(isInteractiveLogin);
4
+ export async function acquireSasToken({ storageAccount: account, container, permissions, loginMethod, tokenExpiresInMs, }) {
5
+ const credential = getCredential(loginMethod);
6
6
  const blobStorage = new BlobServiceClient(createBlobStorageUrl(account), credential);
7
7
  const containerClient = blobStorage.getContainerClient(container);
8
8
  const startsOn = new Date(); // now
@@ -1 +1 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aAAa,EAAE,eAAe,CAAC,aAAa;QAC5C,WAAW,EAAE,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC;QACtD,SAAS;QACT,QAAQ;QACR,QAAQ,EAAE,WAAW,CAAC,KAAK;KAC5B,EACD,iBAAiB,EACjB,OAAO,CACR,CAAC;IAEF,OAAO,cAAc,CAAC,QAAQ,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import {\n BlobServiceClient,\n ContainerSASPermissions,\n SASProtocol,\n generateBlobSASQueryParameters,\n} from '@azure/storage-blob';\nimport type { ConnectionStringOptions } from '../types/ConnectionStringOptions.js';\nimport { createBlobStorageUrl } from './createBlobStorageUrl.js';\nimport { getCredential } from './getCredential.js';\n\nexport async function acquireSasToken({\n storageAccount: account,\n container,\n permissions,\n isInteractiveLogin,\n tokenExpiresInMs,\n}: ConnectionStringOptions) {\n const credential = getCredential(isInteractiveLogin);\n const blobStorage = new BlobServiceClient(createBlobStorageUrl(account), credential);\n const containerClient = blobStorage.getContainerClient(container);\n\n const startsOn = new Date(); // now\n const hourInMs = 3600000;\n const dayInMs = 24 * hourInMs;\n const expiresInMs = 7 * dayInMs; // 7 days (maximum allowed by Azure)\n\n if (tokenExpiresInMs && tokenExpiresInMs > expiresInMs) {\n console.warn('Maximum allowed token expiration is 7 days. Using 7 days instead.');\n tokenExpiresInMs = expiresInMs;\n }\n\n const expiresOn = new Date(startsOn.valueOf() + (tokenExpiresInMs ?? expiresInMs));\n\n const userDelegationKey = await blobStorage.getUserDelegationKey(startsOn, expiresOn);\n\n const sasQueryParams = generateBlobSASQueryParameters(\n {\n containerName: containerClient.containerName,\n permissions: ContainerSASPermissions.from(permissions),\n expiresOn,\n startsOn,\n protocol: SASProtocol.Https,\n },\n userDelegationKey,\n account,\n );\n\n return sasQueryParams.toString();\n}\n"]}
1
+ {"version":3,"file":"acquireSasToken.js","sourceRoot":"","sources":["../../src/authentication/acquireSasToken.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACj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AAQ,EAAE,WAAW,CAAC,KAAK;KAC5B,EACD,iBAAiB,EACjB,OAAO,CACR,CAAC;IAEF,OAAO,cAAc,CAAC,QAAQ,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import {\n BlobServiceClient,\n ContainerSASPermissions,\n SASProtocol,\n generateBlobSASQueryParameters,\n} from '@azure/storage-blob';\nimport type { ConnectionStringOptions } from '../types/ConnectionStringOptions.js';\nimport { createBlobStorageUrl } from './createBlobStorageUrl.js';\nimport { getCredential } from './getCredential.js';\n\nexport async function acquireSasToken({\n storageAccount: account,\n container,\n permissions,\n loginMethod,\n tokenExpiresInMs,\n}: ConnectionStringOptions) {\n const credential = getCredential(loginMethod);\n const blobStorage = new BlobServiceClient(createBlobStorageUrl(account), credential);\n const containerClient = blobStorage.getContainerClient(container);\n\n const startsOn = new Date(); // now\n const hourInMs = 3600000;\n const dayInMs = 24 * hourInMs;\n const expiresInMs = 7 * dayInMs; // 7 days (maximum allowed by Azure)\n\n if (tokenExpiresInMs && tokenExpiresInMs > expiresInMs) {\n console.warn('Maximum allowed token expiration is 7 days. Using 7 days instead.');\n tokenExpiresInMs = expiresInMs;\n }\n\n const expiresOn = new Date(startsOn.valueOf() + (tokenExpiresInMs ?? expiresInMs));\n\n const userDelegationKey = await blobStorage.getUserDelegationKey(startsOn, expiresOn);\n\n const sasQueryParams = generateBlobSASQueryParameters(\n {\n containerName: containerClient.containerName,\n permissions: ContainerSASPermissions.from(permissions),\n expiresOn,\n startsOn,\n protocol: SASProtocol.Https,\n },\n userDelegationKey,\n account,\n );\n\n return sasQueryParams.toString();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getAuthenticatedConnectionString.d.ts","sourceRoot":"","sources":["../../src/authentication/getAuthenticatedConnectionString.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAenF,wBAAsB,gCAAgC,CAAC,uBAAuB,EAAE,uBAAuB,mBAUtG"}
1
+ {"version":3,"file":"getAuthenticatedConnectionString.d.ts","sourceRoot":"","sources":["../../src/authentication/getAuthenticatedConnectionString.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAenF,wBAAsB,gCAAgC,CAAC,uBAAuB,EAAE,uBAAuB,mBAWtG"}
@@ -11,7 +11,7 @@ async function createLocalTokenCacheLazy({ storageAccount, container, permission
11
11
  }
12
12
  export async function getAuthenticatedConnectionString(connectionStringOptions) {
13
13
  // No need to cache tokens if the user is NOT running in interactive mode.
14
- const tokenCache = connectionStringOptions.isInteractiveLogin
14
+ const tokenCache = connectionStringOptions.loginMethod == 'interactive' || connectionStringOptions.loginMethod == 'azure-cli'
15
15
  ? await createLocalTokenCacheLazy(connectionStringOptions)
16
16
  : undefined;
17
17
  const sasToken = await getSasToken({ connectionStringOptions }, { tokenCache, acquireSasToken, isExpired });
@@ -1 +1 @@
1
- {"version":3,"file":"getAuthenticatedConnectionString.js","sourceRoot":"","sources":["../../src/authentication/getAuthenticatedConnectionString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,KAAK,UAAU,yBAAyB,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAA2B;IAC1G,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;IAE/E,MAAM,OAAO,GAAG,mBAAmB,cAAc,EAAE,CAAC;IACpD,MAAM,GAAG,GAAG,aAAa,SAAS,eAAe,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;IAExG,OAAO,IAAI,sBAAsB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAC,uBAAgD;IACrG,0EAA0E;IAC1E,MAAM,UAAU,GAAG,uBAAuB,CAAC,kBAAkB;QAC3D,CAAC,CAAC,MAAM,yBAAyB,CAAC,uBAAuB,CAAC;QAC1D,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,EAAE,uBAAuB,EAAE,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC,CAAC;IAE5G,MAAM,EAAE,cAAc,EAAE,GAAG,uBAAuB,CAAC;IACnD,OAAO,gBAAgB,oBAAoB,CAAC,cAAc,CAAC,0BAA0B,QAAQ,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import { createBlobStorageUrl } from './createBlobStorageUrl.js';\nimport type { ConnectionStringOptions } from '../types/ConnectionStringOptions.js';\nimport { getSasToken } from './getSasToken.js';\nimport { acquireSasToken } from './acquireSasToken.js';\nimport { isExpired } from './isExpired.js';\nimport { ContainerSASPermissions } from '@azure/storage-blob';\n\nasync function createLocalTokenCacheLazy({ storageAccount, container, permissions }: ConnectionStringOptions) {\n const { KeyRingLocalTokenCache } = await import('./KeyRingLocalTokenCache.js');\n\n const service = `cloudpack-cache-${storageAccount}`;\n const key = `container:${container};permission:${ContainerSASPermissions.from(permissions).toString()}`;\n\n return new KeyRingLocalTokenCache(service, key);\n}\n\nexport async function getAuthenticatedConnectionString(connectionStringOptions: ConnectionStringOptions) {\n // No need to cache tokens if the user is NOT running in interactive mode.\n const tokenCache = connectionStringOptions.isInteractiveLogin\n ? await createLocalTokenCacheLazy(connectionStringOptions)\n : undefined;\n\n const sasToken = await getSasToken({ connectionStringOptions }, { tokenCache, acquireSasToken, isExpired });\n\n const { storageAccount } = connectionStringOptions;\n return `BlobEndpoint=${createBlobStorageUrl(storageAccount)};SharedAccessSignature=${sasToken}`;\n}\n"]}
1
+ {"version":3,"file":"getAuthenticatedConnectionString.js","sourceRoot":"","sources":["../../src/authentication/getAuthenticatedConnectionString.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,KAAK,UAAU,yBAAyB,CAAC,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAA2B;IAC1G,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;IAE/E,MAAM,OAAO,GAAG,mBAAmB,cAAc,EAAE,CAAC;IACpD,MAAM,GAAG,GAAG,aAAa,SAAS,eAAe,uBAAuB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;IAExG,OAAO,IAAI,sBAAsB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAC,uBAAgD;IACrG,0EAA0E;IAC1E,MAAM,UAAU,GACd,uBAAuB,CAAC,WAAW,IAAI,aAAa,IAAI,uBAAuB,CAAC,WAAW,IAAI,WAAW;QACxG,CAAC,CAAC,MAAM,yBAAyB,CAAC,uBAAuB,CAAC;QAC1D,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,EAAE,uBAAuB,EAAE,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC,CAAC;IAE5G,MAAM,EAAE,cAAc,EAAE,GAAG,uBAAuB,CAAC;IACnD,OAAO,gBAAgB,oBAAoB,CAAC,cAAc,CAAC,0BAA0B,QAAQ,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import { createBlobStorageUrl } from './createBlobStorageUrl.js';\nimport type { ConnectionStringOptions } from '../types/ConnectionStringOptions.js';\nimport { getSasToken } from './getSasToken.js';\nimport { acquireSasToken } from './acquireSasToken.js';\nimport { isExpired } from './isExpired.js';\nimport { ContainerSASPermissions } from '@azure/storage-blob';\n\nasync function createLocalTokenCacheLazy({ storageAccount, container, permissions }: ConnectionStringOptions) {\n const { KeyRingLocalTokenCache } = await import('./KeyRingLocalTokenCache.js');\n\n const service = `cloudpack-cache-${storageAccount}`;\n const key = `container:${container};permission:${ContainerSASPermissions.from(permissions).toString()}`;\n\n return new KeyRingLocalTokenCache(service, key);\n}\n\nexport async function getAuthenticatedConnectionString(connectionStringOptions: ConnectionStringOptions) {\n // No need to cache tokens if the user is NOT running in interactive mode.\n const tokenCache =\n connectionStringOptions.loginMethod == 'interactive' || connectionStringOptions.loginMethod == 'azure-cli'\n ? await createLocalTokenCacheLazy(connectionStringOptions)\n : undefined;\n\n const sasToken = await getSasToken({ connectionStringOptions }, { tokenCache, acquireSasToken, isExpired });\n\n const { storageAccount } = connectionStringOptions;\n return `BlobEndpoint=${createBlobStorageUrl(storageAccount)};SharedAccessSignature=${sasToken}`;\n}\n"]}
@@ -1,3 +1,4 @@
1
- import { AzureCliCredential, InteractiveBrowserCredential } from '@azure/identity';
2
- export declare function getCredential(isInteractiveLogin: boolean): InteractiveBrowserCredential | AzureCliCredential;
1
+ import { AzureCliCredential, DeviceCodeCredential, InteractiveBrowserCredential } from '@azure/identity';
2
+ import type { LoginMethod } from '../types/LoginMethod.js';
3
+ export declare function getCredential(loginMethod: LoginMethod): InteractiveBrowserCredential | DeviceCodeCredential | AzureCliCredential;
3
4
  //# sourceMappingURL=getCredential.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCredential.d.ts","sourceRoot":"","sources":["../../src/authentication/getCredential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAEnF,wBAAgB,aAAa,CAAC,kBAAkB,EAAE,OAAO,qDAOxD"}
1
+ {"version":3,"file":"getCredential.d.ts","sourceRoot":"","sources":["../../src/authentication/getCredential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AACzG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,wBAAgB,aAAa,CAAC,WAAW,EAAE,WAAW,4EAcrD"}
@@ -1,10 +1,17 @@
1
- import { AzureCliCredential, InteractiveBrowserCredential } from '@azure/identity';
2
- export function getCredential(isInteractiveLogin) {
3
- if (isInteractiveLogin) {
4
- return new InteractiveBrowserCredential({
5
- redirectUri: 'http://localhost:1337',
6
- });
1
+ import { AzureCliCredential, DeviceCodeCredential, InteractiveBrowserCredential } from '@azure/identity';
2
+ export function getCredential(loginMethod) {
3
+ switch (loginMethod) {
4
+ case 'interactive':
5
+ return new InteractiveBrowserCredential({
6
+ redirectUri: 'http://localhost:1337',
7
+ });
8
+ case 'device-code':
9
+ return new DeviceCodeCredential();
10
+ case 'azure-cli':
11
+ return new AzureCliCredential();
12
+ default:
13
+ console.warn('Unknown login method. Using azure-cli as fallback.');
14
+ return new AzureCliCredential();
7
15
  }
8
- return new AzureCliCredential();
9
16
  }
10
17
  //# sourceMappingURL=getCredential.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCredential.js","sourceRoot":"","sources":["../../src/authentication/getCredential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAEnF,MAAM,UAAU,aAAa,CAAC,kBAA2B;IACvD,IAAI,kBAAkB,EAAE;QACtB,OAAO,IAAI,4BAA4B,CAAC;YACtC,WAAW,EAAE,uBAAuB;SACrC,CAAC,CAAC;KACJ;IACD,OAAO,IAAI,kBAAkB,EAAE,CAAC;AAClC,CAAC","sourcesContent":["import { AzureCliCredential, InteractiveBrowserCredential } from '@azure/identity';\n\nexport function getCredential(isInteractiveLogin: boolean) {\n if (isInteractiveLogin) {\n return new InteractiveBrowserCredential({\n redirectUri: 'http://localhost:1337',\n });\n }\n return new AzureCliCredential();\n}\n"]}
1
+ {"version":3,"file":"getCredential.js","sourceRoot":"","sources":["../../src/authentication/getCredential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAGzG,MAAM,UAAU,aAAa,CAAC,WAAwB;IACpD,QAAQ,WAAW,EAAE;QACnB,KAAK,aAAa;YAChB,OAAO,IAAI,4BAA4B,CAAC;gBACtC,WAAW,EAAE,uBAAuB;aACrC,CAAC,CAAC;QACL,KAAK,aAAa;YAChB,OAAO,IAAI,oBAAoB,EAAE,CAAC;QACpC,KAAK,WAAW;YACd,OAAO,IAAI,kBAAkB,EAAE,CAAC;QAClC;YACE,OAAO,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;YACnE,OAAO,IAAI,kBAAkB,EAAE,CAAC;KACnC;AACH,CAAC","sourcesContent":["import { AzureCliCredential, DeviceCodeCredential, InteractiveBrowserCredential } from '@azure/identity';\nimport type { LoginMethod } from '../types/LoginMethod.js';\n\nexport function getCredential(loginMethod: LoginMethod) {\n switch (loginMethod) {\n case 'interactive':\n return new InteractiveBrowserCredential({\n redirectUri: 'http://localhost:1337',\n });\n case 'device-code':\n return new DeviceCodeCredential();\n case 'azure-cli':\n return new AzureCliCredential();\n default:\n console.warn('Unknown login method. Using azure-cli as fallback.');\n return new AzureCliCredential();\n }\n}\n"]}
@@ -1,8 +1,12 @@
1
1
  import type { TaskReporter } from '@ms-cloudpack/task-reporter';
2
2
  import type { ConnectionStringOptions } from './types/ConnectionStringOptions.js';
3
3
  import type { RemoteCacheClient } from './types/RemoteCacheClient.js';
4
+ import type { TelemetryClient } from '@ms-cloudpack/telemetry';
4
5
  export declare function createRemoteCacheClient(options: {
5
6
  connectionStringOptions: ConnectionStringOptions;
6
- reporter: TaskReporter;
7
+ context: {
8
+ reporter: TaskReporter;
9
+ telemetryClient: TelemetryClient;
10
+ };
7
11
  }): Promise<RemoteCacheClient>;
8
12
  //# sourceMappingURL=createRemoteCacheClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createRemoteCacheClient.d.ts","sourceRoot":"","sources":["../src/createRemoteCacheClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAMhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAKtE,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACrD,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,QAAQ,EAAE,YAAY,CAAC;CACxB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAuB7B"}
1
+ {"version":3,"file":"createRemoteCacheClient.d.ts","sourceRoot":"","sources":["../src/createRemoteCacheClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAMhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAItE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACrD,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,OAAO,EAAE;QACP,QAAQ,EAAE,YAAY,CAAC;QACvB,eAAe,EAAE,eAAe,CAAC;KAClC,CAAC;CACH,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAuB7B"}
@@ -7,7 +7,7 @@ import { RetryDecorator } from './decorators/RetryDecorator.js';
7
7
  import { blockListIsInvalidRetryPolicy } from './retry/blockListIsInvalidRetryPolicy.js';
8
8
  import { RetryManager } from './retry/RetryManager.js';
9
9
  export async function createRemoteCacheClient(options) {
10
- const { connectionStringOptions, reporter } = options;
10
+ const { connectionStringOptions, context } = options;
11
11
  const { container } = connectionStringOptions;
12
12
  const connectionString = await getAuthenticatedConnectionString(connectionStringOptions);
13
13
  const cacheClientOptions = {
@@ -20,7 +20,7 @@ export async function createRemoteCacheClient(options) {
20
20
  cacheClient: new AzureRemoteCacheClient(cacheClientOptions),
21
21
  getList: () => getListOfBlobs(cacheClientOptions),
22
22
  }),
23
- }), reporter);
23
+ }), context);
24
24
  return client;
25
25
  }
26
26
  //# sourceMappingURL=createRemoteCacheClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createRemoteCacheClient.js","sourceRoot":"","sources":["../src/createRemoteCacheClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,OAG7C;IACC,MAAM,EAAE,uBAAuB,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACtD,MAAM,EAAE,SAAS,EAAE,GAAG,uBAAuB,CAAC;IAE9C,MAAM,gBAAgB,GAAG,MAAM,gCAAgC,CAAC,uBAAuB,CAAC,CAAC;IAEzF,MAAM,kBAAkB,GAAG;QACzB,SAAS;QACT,gBAAgB;KACjB,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAClC,IAAI,cAAc,CAAC;QACjB,YAAY,EAAE,IAAI,YAAY,CAAC,CAAC,6BAA6B,CAAC,CAAC;QAC/D,WAAW,EAAE,IAAI,iBAAiB,CAAC;YACjC,WAAW,EAAE,IAAI,sBAAsB,CAAC,kBAAkB,CAAC;YAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,kBAAkB,CAAC;SAClD,CAAC;KACH,CAAC,EACF,QAAQ,CACT,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { AzureRemoteCacheClient } from './AzureRemoteCacheClient.js';\nimport { getAuthenticatedConnectionString } from './authentication/getAuthenticatedConnectionString.js';\nimport { InMemoryDecorator } from './decorators/InMemoryDecorator.js';\nimport { ReporterDecorator } from './decorators/ReporterDecorator.js';\nimport { getListOfBlobs } from './getListOfBlobs.js';\nimport type { ConnectionStringOptions } from './types/ConnectionStringOptions.js';\nimport type { RemoteCacheClient } from './types/RemoteCacheClient.js';\nimport { RetryDecorator } from './decorators/RetryDecorator.js';\nimport { blockListIsInvalidRetryPolicy } from './retry/blockListIsInvalidRetryPolicy.js';\nimport { RetryManager } from './retry/RetryManager.js';\n\nexport async function createRemoteCacheClient(options: {\n connectionStringOptions: ConnectionStringOptions;\n reporter: TaskReporter;\n}): Promise<RemoteCacheClient> {\n const { connectionStringOptions, reporter } = options;\n const { container } = connectionStringOptions;\n\n const connectionString = await getAuthenticatedConnectionString(connectionStringOptions);\n\n const cacheClientOptions = {\n container,\n connectionString,\n };\n\n const client = new ReporterDecorator(\n new RetryDecorator({\n retryManager: new RetryManager([blockListIsInvalidRetryPolicy]),\n cacheClient: new InMemoryDecorator({\n cacheClient: new AzureRemoteCacheClient(cacheClientOptions),\n getList: () => getListOfBlobs(cacheClientOptions),\n }),\n }),\n reporter,\n );\n\n return client;\n}\n"]}
1
+ {"version":3,"file":"createRemoteCacheClient.js","sourceRoot":"","sources":["../src/createRemoteCacheClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,OAM7C;IACC,MAAM,EAAE,uBAAuB,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACrD,MAAM,EAAE,SAAS,EAAE,GAAG,uBAAuB,CAAC;IAE9C,MAAM,gBAAgB,GAAG,MAAM,gCAAgC,CAAC,uBAAuB,CAAC,CAAC;IAEzF,MAAM,kBAAkB,GAAG;QACzB,SAAS;QACT,gBAAgB;KACjB,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAClC,IAAI,cAAc,CAAC;QACjB,YAAY,EAAE,IAAI,YAAY,CAAC,CAAC,6BAA6B,CAAC,CAAC;QAC/D,WAAW,EAAE,IAAI,iBAAiB,CAAC;YACjC,WAAW,EAAE,IAAI,sBAAsB,CAAC,kBAAkB,CAAC;YAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,kBAAkB,CAAC;SAClD,CAAC;KACH,CAAC,EACF,OAAO,CACR,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { AzureRemoteCacheClient } from './AzureRemoteCacheClient.js';\nimport { getAuthenticatedConnectionString } from './authentication/getAuthenticatedConnectionString.js';\nimport { InMemoryDecorator } from './decorators/InMemoryDecorator.js';\nimport { ReporterDecorator } from './decorators/ReporterDecorator.js';\nimport { getListOfBlobs } from './getListOfBlobs.js';\nimport type { ConnectionStringOptions } from './types/ConnectionStringOptions.js';\nimport type { RemoteCacheClient } from './types/RemoteCacheClient.js';\nimport { RetryDecorator } from './decorators/RetryDecorator.js';\nimport { blockListIsInvalidRetryPolicy } from './retry/blockListIsInvalidRetryPolicy.js';\nimport { RetryManager } from './retry/RetryManager.js';\nimport type { TelemetryClient } from '@ms-cloudpack/telemetry';\n\nexport async function createRemoteCacheClient(options: {\n connectionStringOptions: ConnectionStringOptions;\n context: {\n reporter: TaskReporter;\n telemetryClient: TelemetryClient;\n };\n}): Promise<RemoteCacheClient> {\n const { connectionStringOptions, context } = options;\n const { container } = connectionStringOptions;\n\n const connectionString = await getAuthenticatedConnectionString(connectionStringOptions);\n\n const cacheClientOptions = {\n container,\n connectionString,\n };\n\n const client = new ReporterDecorator(\n new RetryDecorator({\n retryManager: new RetryManager([blockListIsInvalidRetryPolicy]),\n cacheClient: new InMemoryDecorator({\n cacheClient: new AzureRemoteCacheClient(cacheClientOptions),\n getList: () => getListOfBlobs(cacheClientOptions),\n }),\n }),\n context,\n );\n\n return client;\n}\n"]}
@@ -1,9 +1,13 @@
1
1
  import { type TaskReporter } from '@ms-cloudpack/task-reporter';
2
2
  import type { RemoteCacheClient, RemoteCacheClientDownloadOperationOptions, RemoteCacheClientOperationOptions, RemoteCacheClientOperationResult } from '../types/RemoteCacheClient.js';
3
+ import type { TelemetryClient } from '@ms-cloudpack/telemetry';
3
4
  export declare class ReporterDecorator implements RemoteCacheClient {
4
5
  private readonly client;
5
- private readonly reporter;
6
- constructor(client: RemoteCacheClient, reporter: TaskReporter);
6
+ private readonly context;
7
+ constructor(client: RemoteCacheClient, context: {
8
+ reporter: TaskReporter;
9
+ telemetryClient: TelemetryClient;
10
+ });
7
11
  private buildFailureMessage;
8
12
  uploadFolder(options: RemoteCacheClientDownloadOperationOptions): Promise<RemoteCacheClientOperationResult>;
9
13
  downloadFolder(options: RemoteCacheClientOperationOptions): Promise<RemoteCacheClientOperationResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"ReporterDecorator.d.ts","sourceRoot":"","sources":["../../src/decorators/ReporterDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EACV,iBAAiB,EACjB,yCAAyC,EACzC,iCAAiC,EACjC,gCAAgC,EACjC,MAAM,+BAA+B,CAAC;AAEvC,qBAAa,iBAAkB,YAAW,iBAAiB;IAEvD,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADR,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,YAAY;IAGzC,OAAO,CAAC,mBAAmB;IAWrB,YAAY,CAAC,OAAO,EAAE,yCAAyC;IA0C/D,cAAc,CAAC,OAAO,EAAE,iCAAiC;CAyChE"}
1
+ {"version":3,"file":"ReporterDecorator.d.ts","sourceRoot":"","sources":["../../src/decorators/ReporterDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EACV,iBAAiB,EACjB,yCAAyC,EACzC,iCAAiC,EACjC,gCAAgC,EACjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAuB/D,qBAAa,iBAAkB,YAAW,iBAAiB;IAEvD,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE;QACxB,QAAQ,EAAE,YAAY,CAAC;QACvB,eAAe,EAAE,eAAe,CAAC;KAClC;IAGH,OAAO,CAAC,mBAAmB;IAWrB,YAAY,CAAC,OAAO,EAAE,yCAAyC;IA6C/D,cAAc,CAAC,OAAO,EAAE,iCAAiC;CA6ChE"}
@@ -1,8 +1,24 @@
1
1
  import { bulletedList } from '@ms-cloudpack/task-reporter';
2
+ import { RestError } from '@azure/storage-blob';
3
+ let isAuthErrorReported = false;
4
+ /**
5
+ * Reports an error to the telemetry client. If the error is an auth error, it will be reported only once.
6
+ * @param telemetryClient - The telemetry client to report the error to.
7
+ * @param error - The error to report.
8
+ */
9
+ function reportError(telemetryClient, error) {
10
+ const isAuthError = error instanceof RestError && error.statusCode === 403;
11
+ if (isAuthError && isAuthErrorReported) {
12
+ return; // No need to proceed if auth error is already reported
13
+ }
14
+ telemetryClient.rootSpan.recordException(error);
15
+ // Set isAuthErrorReported only if it's an auth error
16
+ isAuthErrorReported = isAuthError;
17
+ }
2
18
  export class ReporterDecorator {
3
- constructor(client, reporter) {
19
+ constructor(client, context) {
4
20
  this.client = client;
5
- this.reporter = reporter;
21
+ this.context = context;
6
22
  }
7
23
  buildFailureMessage({ folderName, friendlyName, path }, error) {
8
24
  const list = bulletedList([
@@ -15,12 +31,15 @@ export class ReporterDecorator {
15
31
  }
16
32
  async uploadFolder(options) {
17
33
  const { folderName, path, friendlyName } = options;
18
- const task = this.reporter.addTask(`Uploading to remote cache: ${friendlyName}`);
34
+ const task = this.context.reporter.addTask(`Uploading to remote cache: ${friendlyName}`);
19
35
  let uploadResult;
20
36
  try {
21
37
  uploadResult = await this.client.uploadFolder(options);
22
38
  }
23
39
  catch (e) {
40
+ if (e instanceof Error) {
41
+ reportError(this.context.telemetryClient, e);
42
+ }
24
43
  task.complete({
25
44
  status: 'fail',
26
45
  message: this.buildFailureMessage(options, e),
@@ -53,12 +72,15 @@ export class ReporterDecorator {
53
72
  }
54
73
  async downloadFolder(options) {
55
74
  const { folderName, path, friendlyName } = options;
56
- const task = this.reporter.addTask(`Downloading from remote cache: ${friendlyName}`);
75
+ const task = this.context.reporter.addTask(`Downloading from remote cache: ${friendlyName}`);
57
76
  let downloadResult;
58
77
  try {
59
78
  downloadResult = await this.client.downloadFolder(options);
60
79
  }
61
80
  catch (e) {
81
+ if (e instanceof Error) {
82
+ reportError(this.context.telemetryClient, e);
83
+ }
62
84
  task.complete({
63
85
  status: 'fail',
64
86
  message: this.buildFailureMessage(options, e),
@@ -1 +1 @@
1
- {"version":3,"file":"ReporterDecorator.js","sourceRoot":"","sources":["../../src/decorators/ReporterDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAQ9E,MAAM,OAAO,iBAAiB;IAC5B,YACmB,MAAyB,EACzB,QAAsB;QADtB,WAAM,GAAN,MAAM,CAAmB;QACzB,aAAQ,GAAR,QAAQ,CAAc;IACtC,CAAC;IAEI,mBAAmB,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAqC,EAAE,KAAc;QAC/G,MAAM,IAAI,GAAG,YAAY,CAAC;YACxB,eAAe,UAAU,EAAE;YAC3B,SAAS,IAAI,EAAE;YACf,SAAS,YAAY,EAAE;YACvB,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE;SACjE,CAAC,CAAC;QAEH,OAAO,KAAK,IAAI,EAAE,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAkD;QACnE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,8BAA8B,YAAY,EAAE,CAAC,CAAC;QAEjF,IAAI,YAA8C,CAAC;QAEnD,IAAI;YACF,YAAY,GAAG,MAAM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AAI,CAAC,QAAQ,CAAC;gBACZ,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC;aAC9C,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;SACT;QAED,QAAQ,cAAc,EAAE;YACtB,KAAK,SAAS;gBACZ,IAAI,CAAC,QAAQ,CAAC;oBACZ,MAAM,EAAE,UAAU;oBAClB,OAAO,EAAE,YAAY,CAAC,CAAC,eAAe,UAAU,EAAE,EAAE,SAAS,IAAI,EAAE,EAAE,SAAS,YAAY,EAAE,CAAC,CAAC;iBAC/F,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,WAAW;gBACd,IAAI,CAAC,QAAQ,CAAC;oBACZ,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,gCAAgC;iBAC1C,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,eAAe;gBAClB,IAAI,CAAC,QAAQ,CAAC;oBACZ,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,8CAA8C;iBACxD,CAAC,CAAC;gBACH,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,cAAc,EAAE,CAAC,CAAC;SACjE;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF","sourcesContent":["import { bulletedList, type TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type {\n RemoteCacheClient,\n RemoteCacheClientDownloadOperationOptions,\n RemoteCacheClientOperationOptions,\n RemoteCacheClientOperationResult,\n} from '../types/RemoteCacheClient.js';\n\nexport class ReporterDecorator implements RemoteCacheClient {\n constructor(\n private readonly client: RemoteCacheClient,\n private readonly reporter: TaskReporter,\n ) {}\n\n private buildFailureMessage({ folderName, friendlyName, path }: RemoteCacheClientOperationOptions, error: unknown) {\n const list = bulletedList([\n `FolderName: ${folderName}`,\n `Path: ${path}`,\n `Name: ${friendlyName}`,\n `Error: ${error instanceof Error ? error.message : '<Unknown>'}`,\n ]);\n\n return `\\n${list}`;\n }\n\n async uploadFolder(options: RemoteCacheClientDownloadOperationOptions) {\n const { folderName, path, friendlyName } = options;\n const task = this.reporter.addTask(`Uploading to remote cache: ${friendlyName}`);\n\n let uploadResult: RemoteCacheClientOperationResult;\n\n try {\n uploadResult = await this.client.uploadFolder(options);\n } catch (e) {\n task.complete({\n status: 'fail',\n message: this.buildFailureMessage(options, e),\n });\n throw e;\n }\n\n switch (uploadResult) {\n case 'success':\n task.complete({\n status: 'complete',\n details: bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Name: ${friendlyName}`]),\n });\n break;\n case 'not-found':\n task.complete({\n status: 'skip',\n message: `Not found in the local cache.`,\n });\n break;\n case 'already-exist':\n task.complete({\n status: 'skip',\n message: `Package is already exist in the remote cache.`,\n });\n break;\n default:\n throw new Error(`Unknown upload result: ${uploadResult}`);\n }\n\n return uploadResult;\n }\n\n async downloadFolder(options: RemoteCacheClientOperationOptions) {\n const { folderName, path, friendlyName } = options;\n const task = this.reporter.addTask(`Downloading from remote cache: ${friendlyName}`);\n\n let downloadResult: RemoteCacheClientOperationResult;\n\n try {\n downloadResult = await this.client.downloadFolder(options);\n } catch (e) {\n task.complete({\n status: 'fail',\n message: this.buildFailureMessage(options, e),\n });\n throw e;\n }\n\n switch (downloadResult) {\n case 'success':\n task.complete({\n status: 'complete',\n details: bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Name: ${friendlyName}`]),\n });\n break;\n case 'not-found':\n task.complete({\n status: 'skip',\n message: `Not found in the remote cache.`,\n });\n break;\n case 'already-exist':\n task.complete({\n status: 'skip',\n message: `Package is already exist in the local cache.`,\n });\n break;\n default:\n throw new Error(`Unknown download result: ${downloadResult}`);\n }\n\n return downloadResult;\n }\n}\n"]}
1
+ {"version":3,"file":"ReporterDecorator.js","sourceRoot":"","sources":["../../src/decorators/ReporterDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAQ9E,OAAO,EAAE,SA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AC,OAAO,CAAC,CAAC;SAC5D;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,YAAY,KAAK,EAAE;gBACtB,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;aAC9C;YAED,IAAI,CAAC,QAAQ,CAAC;gBACZ,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC;aAC9C,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;SACT;QAED,QAAQ,cAAc,EAAE;YACtB,KAAK,SAAS;gBACZ,IAAI,CAAC,QAAQ,CAAC;oBACZ,MAAM,EAAE,UAAU;oBAClB,OAAO,EAAE,YAAY,CAAC,CAAC,eAAe,UAAU,EAAE,EAAE,SAAS,IAAI,EAAE,EAAE,SAAS,YAAY,EAAE,CAAC,CAAC;iBAC/F,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,WAAW;gBACd,IAAI,CAAC,QAAQ,CAAC;oBACZ,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,gCAAgC;iBAC1C,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,eAAe;gBAClB,IAAI,CAAC,QAAQ,CAAC;oBACZ,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,8CAA8C;iBACxD,CAAC,CAAC;gBACH,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,cAAc,EAAE,CAAC,CAAC;SACjE;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF","sourcesContent":["import { bulletedList, type TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type {\n RemoteCacheClient,\n RemoteCacheClientDownloadOperationOptions,\n RemoteCacheClientOperationOptions,\n RemoteCacheClientOperationResult,\n} from '../types/RemoteCacheClient.js';\nimport type { TelemetryClient } from '@ms-cloudpack/telemetry';\nimport { RestError } from '@azure/storage-blob';\n\nlet isAuthErrorReported: boolean = false;\n\n/**\n * Reports an error to the telemetry client. If the error is an auth error, it will be reported only once.\n * @param telemetryClient - The telemetry client to report the error to.\n * @param error - The error to report.\n */\nfunction reportError(telemetryClient: TelemetryClient, error: Error) {\n const isAuthError = error instanceof RestError && error.statusCode === 403;\n\n if (isAuthError && isAuthErrorReported) {\n return; // No need to proceed if auth error is already reported\n }\n\n telemetryClient.rootSpan.recordException(error);\n\n // Set isAuthErrorReported only if it's an auth error\n isAuthErrorReported = isAuthError;\n}\n\nexport class ReporterDecorator implements RemoteCacheClient {\n constructor(\n private readonly client: RemoteCacheClient,\n private readonly context: {\n reporter: TaskReporter;\n telemetryClient: TelemetryClient;\n },\n ) {}\n\n private buildFailureMessage({ folderName, friendlyName, path }: RemoteCacheClientOperationOptions, error: unknown) {\n const list = bulletedList([\n `FolderName: ${folderName}`,\n `Path: ${path}`,\n `Name: ${friendlyName}`,\n `Error: ${error instanceof Error ? error.message : '<Unknown>'}`,\n ]);\n\n return `\\n${list}`;\n }\n\n async uploadFolder(options: RemoteCacheClientDownloadOperationOptions) {\n const { folderName, path, friendlyName } = options;\n const task = this.context.reporter.addTask(`Uploading to remote cache: ${friendlyName}`);\n\n let uploadResult: RemoteCacheClientOperationResult;\n\n try {\n uploadResult = await this.client.uploadFolder(options);\n } catch (e) {\n if (e instanceof Error) {\n reportError(this.context.telemetryClient, e);\n }\n task.complete({\n status: 'fail',\n message: this.buildFailureMessage(options, e),\n });\n throw e;\n }\n\n switch (uploadResult) {\n case 'success':\n task.complete({\n status: 'complete',\n details: bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Name: ${friendlyName}`]),\n });\n break;\n case 'not-found':\n task.complete({\n status: 'skip',\n message: `Not found in the local cache.`,\n });\n break;\n case 'already-exist':\n task.complete({\n status: 'skip',\n message: `Package is already exist in the remote cache.`,\n });\n break;\n default:\n throw new Error(`Unknown upload result: ${uploadResult}`);\n }\n\n return uploadResult;\n }\n\n async downloadFolder(options: RemoteCacheClientOperationOptions) {\n const { folderName, path, friendlyName } = options;\n const task = this.context.reporter.addTask(`Downloading from remote cache: ${friendlyName}`);\n\n let downloadResult: RemoteCacheClientOperationResult;\n\n try {\n downloadResult = await this.client.downloadFolder(options);\n } catch (e) {\n if (e instanceof Error) {\n reportError(this.context.telemetryClient, e);\n }\n\n task.complete({\n status: 'fail',\n message: this.buildFailureMessage(options, e),\n });\n throw e;\n }\n\n switch (downloadResult) {\n case 'success':\n task.complete({\n status: 'complete',\n details: bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Name: ${friendlyName}`]),\n });\n break;\n case 'not-found':\n task.complete({\n status: 'skip',\n message: `Not found in the remote cache.`,\n });\n break;\n case 'already-exist':\n task.complete({\n status: 'skip',\n message: `Package is already exist in the local cache.`,\n });\n break;\n default:\n throw new Error(`Unknown download result: ${downloadResult}`);\n }\n\n return downloadResult;\n }\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { createRemoteCacheClient } from './createRemoteCacheClient.js';
2
2
  export type { RemoteCacheClient, RemoteCacheClientDownloadOperationOptions, RemoteCacheClientOperationOptions, RemoteCacheClientOperationResult, } from './types/RemoteCacheClient.js';
3
3
  export type { ConnectionStringOptions } from './types/ConnectionStringOptions.js';
4
+ export type { LoginMethod } from './types/LoginMethod.js';
4
5
  export type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,YAAY,EACV,iBAAiB,EACjB,yCAAyC,EACzC,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAClF,YAAY,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,YAAY,EACV,iBAAiB,EACjB,yCAAyC,EACzC,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAClF,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["export { createRemoteCacheClient } from './createRemoteCacheClient.js';\n\nexport type {\n RemoteCacheClient,\n RemoteCacheClientDownloadOperationOptions,\n RemoteCacheClientOperationOptions,\n RemoteCacheClientOperationResult,\n} from './types/RemoteCacheClient.js';\nexport type { ConnectionStringOptions } from './types/ConnectionStringOptions.js';\nexport type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["export { createRemoteCacheClient } from './createRemoteCacheClient.js';\n\nexport type {\n RemoteCacheClient,\n RemoteCacheClientDownloadOperationOptions,\n RemoteCacheClientOperationOptions,\n RemoteCacheClientOperationResult,\n} from './types/RemoteCacheClient.js';\nexport type { ConnectionStringOptions } from './types/ConnectionStringOptions.js';\nexport type { LoginMethod } from './types/LoginMethod.js';\nexport type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.38.1"
8
+ "packageVersion": "7.38.3"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,3 +1,4 @@
1
+ import type { LoginMethod } from './LoginMethod.js';
1
2
  export interface ConnectionStringOptions {
2
3
  storageAccount: string;
3
4
  container: string;
@@ -7,6 +8,6 @@ export interface ConnectionStringOptions {
7
8
  list: boolean;
8
9
  };
9
10
  tokenExpiresInMs?: number;
10
- isInteractiveLogin: boolean;
11
+ loginMethod: LoginMethod;
11
12
  }
12
13
  //# sourceMappingURL=ConnectionStringOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionStringOptions.d.ts","sourceRoot":"","sources":["../../src/types/ConnectionStringOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE;QACX,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,EAAE,OAAO,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;CAC7B"}
1
+ {"version":3,"file":"ConnectionStringOptions.d.ts","sourceRoot":"","sources":["../../src/types/ConnectionStringOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE;QACX,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,EAAE,OAAO,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,WAAW,CAAC;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionStringOptions.js","sourceRoot":"","sources":["../../src/types/ConnectionStringOptions.ts"],"names":[],"mappings":"","sourcesContent":["export interface ConnectionStringOptions {\n storageAccount: string;\n container: string;\n permissions: {\n read: boolean;\n write: boolean;\n list: boolean;\n };\n tokenExpiresInMs?: number;\n isInteractiveLogin: boolean;\n}\n"]}
1
+ {"version":3,"file":"ConnectionStringOptions.js","sourceRoot":"","sources":["../../src/types/ConnectionStringOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { LoginMethod } from './LoginMethod.js';\n\nexport interface ConnectionStringOptions {\n storageAccount: string;\n container: string;\n permissions: {\n read: boolean;\n write: boolean;\n list: boolean;\n };\n tokenExpiresInMs?: number;\n loginMethod: LoginMethod;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export type LoginMethod = 'interactive' | 'azure-cli' | 'device-code';
2
+ //# sourceMappingURL=LoginMethod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoginMethod.d.ts","sourceRoot":"","sources":["../../src/types/LoginMethod.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,WAAW,GAAG,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=LoginMethod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoginMethod.js","sourceRoot":"","sources":["../../src/types/LoginMethod.ts"],"names":[],"mappings":"","sourcesContent":["export type LoginMethod = 'interactive' | 'azure-cli' | 'device-code';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/remote-cache",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Manages syncing the local Cloudpack cached assets to/from a remote storage service.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,6 +32,7 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@ms-cloudpack/task-reporter": "^0.10.2",
35
+ "@ms-cloudpack/telemetry": "^0.4.4",
35
36
  "@azure/identity": "^3.4.0",
36
37
  "@azure/storage-blob": "^12.17.0",
37
38
  "@napi-rs/keyring": "^1.1.3",