@ms-cloudpack/remote-cache 0.4.7 → 0.5.1-beta.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 (97) hide show
  1. package/dist/AzureRemoteCacheClient-2PRAPCJH.js +52049 -0
  2. package/dist/AzureRemoteCacheClient-2PRAPCJH.js.map +7 -0
  3. package/dist/ReporterDecorator-BYNXV72I.js +126 -0
  4. package/dist/ReporterDecorator-BYNXV72I.js.map +7 -0
  5. package/dist/chunk-G3ME7OWS.js +49567 -0
  6. package/dist/chunk-G3ME7OWS.js.map +7 -0
  7. package/dist/chunk-GFT2G5UO.js +50 -0
  8. package/dist/chunk-GFT2G5UO.js.map +7 -0
  9. package/dist/chunk-KKZU5JW4.js +1071 -0
  10. package/dist/chunk-KKZU5JW4.js.map +7 -0
  11. package/dist/chunk-VVROC42R.js +182 -0
  12. package/dist/chunk-VVROC42R.js.map +7 -0
  13. package/dist/chunk-XKOU5VXX.js +9 -0
  14. package/dist/chunk-XKOU5VXX.js.map +7 -0
  15. package/dist/getCredential-MJEIGDVB.js +23981 -0
  16. package/dist/getCredential-MJEIGDVB.js.map +7 -0
  17. package/dist/getListOfBlobs-LKU62UR5.js +26 -0
  18. package/dist/getListOfBlobs-LKU62UR5.js.map +7 -0
  19. package/dist/index.js +93 -0
  20. package/dist/index.js.map +7 -0
  21. package/lib/AzureRemoteCacheClient.d.ts +5 -5
  22. package/lib/decorators/InMemoryDecorator.d.ts +2 -2
  23. package/lib/decorators/InMemoryDecorator.test.d.ts +2 -0
  24. package/lib/decorators/ReporterDecorator.d.ts +2 -2
  25. package/lib/decorators/RetryDecorator.d.ts +2 -2
  26. package/lib/decorators/RetryDecorator.test.d.ts +2 -0
  27. package/lib/index.d.ts +1 -1
  28. package/lib/types/RemoteCacheClient.d.ts +12 -3
  29. package/package.json +13 -13
  30. package/lib/AzureRemoteCacheClient.d.ts.map +0 -1
  31. package/lib/AzureRemoteCacheClient.js +0 -51
  32. package/lib/AzureRemoteCacheClient.js.map +0 -1
  33. package/lib/Task.d.ts.map +0 -1
  34. package/lib/Task.js +0 -2
  35. package/lib/Task.js.map +0 -1
  36. package/lib/authentication/getAuthenticationRecord.d.ts.map +0 -1
  37. package/lib/authentication/getAuthenticationRecord.js +0 -17
  38. package/lib/authentication/getAuthenticationRecord.js.map +0 -1
  39. package/lib/authentication/getAuthenticationRecordPath.d.ts.map +0 -1
  40. package/lib/authentication/getAuthenticationRecordPath.js +0 -10
  41. package/lib/authentication/getAuthenticationRecordPath.js.map +0 -1
  42. package/lib/authentication/getCredential.d.ts.map +0 -1
  43. package/lib/authentication/getCredential.js +0 -61
  44. package/lib/authentication/getCredential.js.map +0 -1
  45. package/lib/authentication/saveAuthenticationRecord.d.ts.map +0 -1
  46. package/lib/authentication/saveAuthenticationRecord.js +0 -17
  47. package/lib/authentication/saveAuthenticationRecord.js.map +0 -1
  48. package/lib/cache-persistance/cachePersistencePlugin.d.ts.map +0 -1
  49. package/lib/cache-persistance/cachePersistencePlugin.js +0 -35
  50. package/lib/cache-persistance/cachePersistencePlugin.js.map +0 -1
  51. package/lib/cache-persistance/platforms.d.ts.map +0 -1
  52. package/lib/cache-persistance/platforms.js +0 -109
  53. package/lib/cache-persistance/platforms.js.map +0 -1
  54. package/lib/cache-persistance/provider.d.ts.map +0 -1
  55. package/lib/cache-persistance/provider.js +0 -26
  56. package/lib/cache-persistance/provider.js.map +0 -1
  57. package/lib/createBlobStorageUrl.d.ts.map +0 -1
  58. package/lib/createBlobStorageUrl.js +0 -4
  59. package/lib/createBlobStorageUrl.js.map +0 -1
  60. package/lib/createRemoteCacheClient.d.ts.map +0 -1
  61. package/lib/createRemoteCacheClient.js +0 -27
  62. package/lib/createRemoteCacheClient.js.map +0 -1
  63. package/lib/decorators/InMemoryDecorator.d.ts.map +0 -1
  64. package/lib/decorators/InMemoryDecorator.js +0 -29
  65. package/lib/decorators/InMemoryDecorator.js.map +0 -1
  66. package/lib/decorators/ReporterDecorator.d.ts.map +0 -1
  67. package/lib/decorators/ReporterDecorator.js +0 -121
  68. package/lib/decorators/ReporterDecorator.js.map +0 -1
  69. package/lib/decorators/RetryDecorator.d.ts.map +0 -1
  70. package/lib/decorators/RetryDecorator.js +0 -27
  71. package/lib/decorators/RetryDecorator.js.map +0 -1
  72. package/lib/getListOfBlobs.d.ts.map +0 -1
  73. package/lib/getListOfBlobs.js +0 -15
  74. package/lib/getListOfBlobs.js.map +0 -1
  75. package/lib/index.d.ts.map +0 -1
  76. package/lib/index.js +0 -2
  77. package/lib/index.js.map +0 -1
  78. package/lib/retry/blockListIsInvalidRetryPolicy.d.ts.map +0 -1
  79. package/lib/retry/blockListIsInvalidRetryPolicy.js +0 -8
  80. package/lib/retry/blockListIsInvalidRetryPolicy.js.map +0 -1
  81. package/lib/tsdoc-metadata.json +0 -11
  82. package/lib/types/LoginMethod.d.ts.map +0 -1
  83. package/lib/types/LoginMethod.js +0 -2
  84. package/lib/types/LoginMethod.js.map +0 -1
  85. package/lib/types/PackageToSync.d.ts +0 -7
  86. package/lib/types/PackageToSync.d.ts.map +0 -1
  87. package/lib/types/PackageToSync.js +0 -2
  88. package/lib/types/PackageToSync.js.map +0 -1
  89. package/lib/types/RemoteCacheClient.d.ts.map +0 -1
  90. package/lib/types/RemoteCacheClient.js +0 -2
  91. package/lib/types/RemoteCacheClient.js.map +0 -1
  92. package/lib/types/RemoteCacheClientOptions.d.ts.map +0 -1
  93. package/lib/types/RemoteCacheClientOptions.js +0 -2
  94. package/lib/types/RemoteCacheClientOptions.js.map +0 -1
  95. package/lib/types/RetryPolicy.d.ts.map +0 -1
  96. package/lib/types/RetryPolicy.js +0 -2
  97. package/lib/types/RetryPolicy.js.map +0 -1
@@ -1,109 +0,0 @@
1
- /**
2
- * This file is a fork of https://github.com/altinokdarici/azure-sdk-for-js/tree/main/sdk/identity/identity-cache-persistence
3
- */
4
- // Copyright (c) Microsoft Corporation.
5
- // Licensed under the MIT license.
6
- import * as path from 'path';
7
- import { DataProtectionScope, FilePersistence, FilePersistenceWithDataProtection, KeychainPersistence, LibSecretPersistence, } from '@azure/msal-node-extensions';
8
- /**
9
- * Local application data folder
10
- * Expected values:
11
- * - Darwin: '/Users/user/'
12
- * - Windows 8+: 'C:\Users\user\AppData\Local'
13
- * - Linux: '/home/user/.local/share'
14
- * @internal
15
- */
16
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
17
- const localApplicationDataFolder = process.env.APPDATA?.replace?.(/(.Roaming)*$/, '\\Local') ?? process.env.HOME;
18
- /**
19
- * Dictionary of values that we use as default as we discover, pick and enable the persistence layer.
20
- * @internal
21
- */
22
- export const defaultMsalValues = {
23
- tokenCache: {
24
- name: 'msal.cache',
25
- // Expected values:
26
- // - Darwin: '/Users/user/.IdentityService'
27
- // - Windows 8+: 'C:\Users\user\AppData\Local\.IdentityService'
28
- // - Linux: '/home/user/.IdentityService'
29
- directory: path.join(localApplicationDataFolder, '.IdentityService'),
30
- },
31
- keyRing: {
32
- label: 'MSALCache',
33
- schema: 'msal.cache',
34
- collection: 'default',
35
- attributes: {
36
- MsalClientID: 'Microsoft.Developer.IdentityService',
37
- 'Microsoft.Developer.IdentityService': '1.0.0.0',
38
- },
39
- service: 'Microsoft.Developer.IdentityService',
40
- account: 'MSALCache',
41
- },
42
- keyChain: {
43
- service: 'Microsoft.Developer.IdentityService',
44
- account: 'MSALCache',
45
- },
46
- };
47
- /**
48
- * Expected responses:
49
- * - Darwin: '/Users/user/.IdentityService/<name>'
50
- * - Windows 8+: 'C:\Users\user\AppData\Local\.IdentityService\<name>'
51
- * - Linux: '/home/user/.IdentityService/<name>'
52
- * @internal
53
- */
54
- function getPersistencePath(name) {
55
- return path.join(defaultMsalValues.tokenCache.directory, name);
56
- }
57
- /**
58
- * Set of the platforms we attempt to deliver persistence on.
59
- *
60
- * - On Windows we use DPAPI.
61
- * - On OSX (Darwin), we try to use the system's Keychain, otherwise if the property `unsafeAllowUnencryptedStorage` is set to true, we use an unencrypted file.
62
- * - On Linux, we try to use the system's Keyring, otherwise if the property `unsafeAllowUnencryptedStorage` is set to true, we use an unencrypted file.
63
- *
64
- * Other platforms _are not supported_ at this time.
65
- *
66
- * @internal
67
- */
68
- export const msalPersistencePlatforms = {
69
- win32: ({ name = defaultMsalValues.tokenCache.name } = {}) => FilePersistenceWithDataProtection.create(getPersistencePath(name), DataProtectionScope.CurrentUser),
70
- darwin: async (options = {}) => {
71
- const { name, unsafeAllowUnencryptedStorage } = options;
72
- const { service, account } = defaultMsalValues.keyChain;
73
- const persistencePath = getPersistencePath(name || defaultMsalValues.tokenCache.name);
74
- try {
75
- const persistence = await KeychainPersistence.create(persistencePath, service, account);
76
- // If we don't encounter an error when trying to read from the keychain, then we should be good to go.
77
- await persistence.load();
78
- return persistence;
79
- }
80
- catch {
81
- // If we got an error while trying to read from the keyring,
82
- // we will proceed only if the user has specified that unencrypted storage is allowed.
83
- if (!unsafeAllowUnencryptedStorage) {
84
- throw new Error('Unable to read from the macOS Keychain.');
85
- }
86
- return FilePersistence.create(persistencePath);
87
- }
88
- },
89
- linux: async (options = {}) => {
90
- const { name, unsafeAllowUnencryptedStorage } = options;
91
- const { service, account } = defaultMsalValues.keyRing;
92
- const persistencePath = getPersistencePath(name || defaultMsalValues.tokenCache.name);
93
- try {
94
- const persistence = await LibSecretPersistence.create(persistencePath, service, account);
95
- // If we don't encounter an error when trying to read from the keyring, then we should be good to go.
96
- await persistence.load();
97
- return persistence;
98
- }
99
- catch {
100
- // If we got an error while trying to read from the keyring,
101
- // we will proceed only if the user has specified that unencrypted storage is allowed.
102
- if (!unsafeAllowUnencryptedStorage) {
103
- throw new Error('Unable to read from the system keyring (libsecret).');
104
- }
105
- return FilePersistence.create(persistencePath);
106
- }
107
- },
108
- };
109
- //# sourceMappingURL=platforms.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platforms.js","sourceRoot":"","sources":["../../src/cache-persistance/platforms.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uCAAuC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IAAI,EAAE,CAAC;YACzB,OAAO,WAAW,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACP,4DAA4D;YAC5D,sFAAsF;YACtF,IAAI,CAAC,6BAA6B,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;YACzE,CAAC;YACD,OAAO,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["/**\n * This file is a fork of https://github.com/altinokdarici/azure-sdk-for-js/tree/main/sdk/identity/identity-cache-persistence\n */\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport * as path from 'path';\nimport {\n DataProtectionScope,\n FilePersistence,\n FilePersistenceWithDataProtection,\n KeychainPersistence,\n LibSecretPersistence,\n type IPersistence as Persistence,\n} from '@azure/msal-node-extensions';\nimport type { TokenCachePersistenceOptions } from '@azure/identity';\n\n/**\n * Local application data folder\n * Expected values:\n * - Darwin: '/Users/user/'\n * - Windows 8+: 'C:\\Users\\user\\AppData\\Local'\n * - Linux: '/home/user/.local/share'\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\nconst localApplicationDataFolder = process.env.APPDATA?.replace?.(/(.Roaming)*$/, '\\\\Local') ?? process.env.HOME!;\n\n/**\n * Dictionary of values that we use as default as we discover, pick and enable the persistence layer.\n * @internal\n */\nexport const defaultMsalValues = {\n tokenCache: {\n name: 'msal.cache',\n // Expected values:\n // - Darwin: '/Users/user/.IdentityService'\n // - Windows 8+: 'C:\\Users\\user\\AppData\\Local\\.IdentityService'\n // - Linux: '/home/user/.IdentityService'\n directory: path.join(localApplicationDataFolder, '.IdentityService'),\n },\n keyRing: {\n label: 'MSALCache',\n schema: 'msal.cache',\n collection: 'default',\n attributes: {\n MsalClientID: 'Microsoft.Developer.IdentityService',\n 'Microsoft.Developer.IdentityService': '1.0.0.0',\n },\n service: 'Microsoft.Developer.IdentityService',\n account: 'MSALCache',\n },\n keyChain: {\n service: 'Microsoft.Developer.IdentityService',\n account: 'MSALCache',\n },\n};\n\n/**\n * Options that are used by the underlying MSAL cache provider.\n * @internal\n */\nexport type MsalPersistenceOptions = Omit<TokenCachePersistenceOptions, 'enabled'>;\n\n/**\n * A function that returns a persistent token cache instance.\n * @internal\n */\ntype MsalPersistenceFactory = (options?: MsalPersistenceOptions) => Promise<Persistence>;\n\n/**\n * Expected responses:\n * - Darwin: '/Users/user/.IdentityService/<name>'\n * - Windows 8+: 'C:\\Users\\user\\AppData\\Local\\.IdentityService\\<name>'\n * - Linux: '/home/user/.IdentityService/<name>'\n * @internal\n */\nfunction getPersistencePath(name: string): string {\n return path.join(defaultMsalValues.tokenCache.directory, name);\n}\n\n/**\n * Set of the platforms we attempt to deliver persistence on.\n *\n * - On Windows we use DPAPI.\n * - On OSX (Darwin), we try to use the system's Keychain, otherwise if the property `unsafeAllowUnencryptedStorage` is set to true, we use an unencrypted file.\n * - On Linux, we try to use the system's Keyring, otherwise if the property `unsafeAllowUnencryptedStorage` is set to true, we use an unencrypted file.\n *\n * Other platforms _are not supported_ at this time.\n *\n * @internal\n */\nexport const msalPersistencePlatforms: Partial<Record<NodeJS.Platform, MsalPersistenceFactory>> = {\n win32: ({ name = defaultMsalValues.tokenCache.name } = {}): Promise<Persistence> =>\n FilePersistenceWithDataProtection.create(getPersistencePath(name), DataProtectionScope.CurrentUser),\n\n darwin: async (options: MsalPersistenceOptions = {}): Promise<Persistence> => {\n const { name, unsafeAllowUnencryptedStorage } = options;\n const { service, account } = defaultMsalValues.keyChain;\n const persistencePath = getPersistencePath(name || defaultMsalValues.tokenCache.name);\n\n try {\n const persistence = await KeychainPersistence.create(persistencePath, service, account);\n // If we don't encounter an error when trying to read from the keychain, then we should be good to go.\n await persistence.load();\n return persistence;\n } catch {\n // If we got an error while trying to read from the keyring,\n // we will proceed only if the user has specified that unencrypted storage is allowed.\n if (!unsafeAllowUnencryptedStorage) {\n throw new Error('Unable to read from the macOS Keychain.');\n }\n return FilePersistence.create(persistencePath);\n }\n },\n\n linux: async (options: MsalPersistenceOptions = {}): Promise<Persistence> => {\n const { name, unsafeAllowUnencryptedStorage } = options;\n const { service, account } = defaultMsalValues.keyRing;\n const persistencePath = getPersistencePath(name || defaultMsalValues.tokenCache.name);\n\n try {\n const persistence = await LibSecretPersistence.create(persistencePath, service, account);\n // If we don't encounter an error when trying to read from the keyring, then we should be good to go.\n await persistence.load();\n return persistence;\n } catch {\n // If we got an error while trying to read from the keyring,\n // we will proceed only if the user has specified that unencrypted storage is allowed.\n if (!unsafeAllowUnencryptedStorage) {\n throw new Error('Unable to read from the system keyring (libsecret).');\n }\n return FilePersistence.create(persistencePath);\n }\n },\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/cache-persistance/provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,IAAI,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,KAAK,EAAE,YAAY,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpE;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,CAQ7F;AAED,wBAAsB,4BAA4B,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,CAOzG"}
@@ -1,26 +0,0 @@
1
- /**
2
- * This file is a fork of https://github.com/altinokdarici/azure-sdk-for-js/tree/main/sdk/identity/identity-cache-persistence
3
- */
4
- import { msalPersistencePlatforms } from './platforms.js';
5
- import { PersistenceCachePlugin } from '@azure/msal-node-extensions';
6
- /**
7
- * This is used to gain access to the underlying Persistence instance, which we use for testing
8
- *
9
- * @returns a raw persistence instance
10
- * @internal
11
- */
12
- export async function createPersistence(options) {
13
- const persistence = await msalPersistencePlatforms[process.platform]?.(options);
14
- if (persistence === undefined) {
15
- throw new Error('no persistence providers are available on this platform');
16
- }
17
- return persistence;
18
- }
19
- export async function createPersistenceCachePlugin(options) {
20
- const persistence = await createPersistence(options ?? {});
21
- return new PersistenceCachePlugin(persistence, {
22
- retryNumber: 100,
23
- retryDelay: 50,
24
- });
25
- }
26
- //# sourceMappingURL=provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/cache-persistance/provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAA+B;IACrE,MAAM,WAAW,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IAEhF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,OAAgC;IACjF,MAAM,WAAW,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAE3D,OAAO,IAAI,sBAAsB,CAAC,WAAW,EAAE;QAC7C,WAAW,EAAE,GAAG;QAChB,UAAU,EAAE,EAAE;KACf,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * This file is a fork of https://github.com/altinokdarici/azure-sdk-for-js/tree/main/sdk/identity/identity-cache-persistence\n */\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport type { MsalPersistenceOptions } from './platforms.js';\nimport { msalPersistencePlatforms } from './platforms.js';\nimport type { IPersistence as Persistence } from '@azure/msal-node-extensions';\nimport { PersistenceCachePlugin } from '@azure/msal-node-extensions';\nimport type { ICachePlugin as CachePlugin } from '@azure/msal-node';\n\n/**\n * This is used to gain access to the underlying Persistence instance, which we use for testing\n *\n * @returns a raw persistence instance\n * @internal\n */\nexport async function createPersistence(options: MsalPersistenceOptions): Promise<Persistence> {\n const persistence = await msalPersistencePlatforms[process.platform]?.(options);\n\n if (persistence === undefined) {\n throw new Error('no persistence providers are available on this platform');\n }\n\n return persistence;\n}\n\nexport async function createPersistenceCachePlugin(options?: MsalPersistenceOptions): Promise<CachePlugin> {\n const persistence = await createPersistence(options ?? {});\n\n return new PersistenceCachePlugin(persistence, {\n retryNumber: 100,\n retryDelay: 50,\n });\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createBlobStorageUrl.d.ts","sourceRoot":"","sources":["../src/createBlobStorageUrl.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,MAAM,UAE1D"}
@@ -1,4 +0,0 @@
1
- export function createBlobStorageUrl(storageAccount) {
2
- return `https://${storageAccount}.blob.core.windows.net`;
3
- }
4
- //# sourceMappingURL=createBlobStorageUrl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createBlobStorageUrl.js","sourceRoot":"","sources":["../src/createBlobStorageUrl.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB,CAAC,cAAsB;IACzD,OAAO,WAAW,cAAc,wBAAwB,CAAC;AAC3D,CAAC","sourcesContent":["export function createBlobStorageUrl(storageAccount: string) {\n return `https://${storageAccount}.blob.core.windows.net`;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createRemoteCacheClient.d.ts","sourceRoot":"","sources":["../src/createRemoteCacheClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAMtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE;QACP,cAAc,EAAE,MAAM,CAAC;QACvB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,WAAW,CAAC;QACzB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,OAAO,EAAE;QACP,QAAQ,EAAE,YAAY,CAAC;QACvB,eAAe,EAAE,eAAe,CAAC;KAClC,CAAC;CACH;AAED,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAwB/G"}
@@ -1,27 +0,0 @@
1
- import { AzureRemoteCacheClient } from './AzureRemoteCacheClient.js';
2
- import { InMemoryDecorator } from './decorators/InMemoryDecorator.js';
3
- import { ReporterDecorator } from './decorators/ReporterDecorator.js';
4
- import { getListOfBlobs } from './getListOfBlobs.js';
5
- import { RetryDecorator } from './decorators/RetryDecorator.js';
6
- import { blockListIsInvalidRetryPolicy } from './retry/blockListIsInvalidRetryPolicy.js';
7
- import { RetryManager } from '@ms-cloudpack/retry';
8
- import { getCredential } from './authentication/getCredential.js';
9
- export async function createRemoteCacheClient(params) {
10
- const { context, options } = params;
11
- const { container, loginMethod, storageAccount, cachePath } = options;
12
- const credential = await getCredential(loginMethod, cachePath);
13
- const remoteCacheClientOptions = {
14
- storageAccount,
15
- container,
16
- credential,
17
- };
18
- const client = new ReporterDecorator(new RetryDecorator({
19
- retryManager: new RetryManager([blockListIsInvalidRetryPolicy]),
20
- cacheClient: new InMemoryDecorator({
21
- cacheClient: new AzureRemoteCacheClient(remoteCacheClientOptions),
22
- getList: () => getListOfBlobs(remoteCacheClientOptions),
23
- }),
24
- }), context);
25
- return client;
26
- }
27
- //# sourceMappingURL=createRemoteCacheClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createRemoteCacheClient.js","sourceRoot":"","sources":["../src/createRemoteCacheClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAiBlE,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,MAAqC;IACjF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACpC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAEtE,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAE/D,MAAM,wBAAwB,GAA6B;QACzD,cAAc;QACd,SAAS;QACT,UAAU;KACX,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,wBAAwB,CAAC;YACjE,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,wBAAwB,CAAC;SACxD,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 { InMemoryDecorator } from './decorators/InMemoryDecorator.js';\nimport { ReporterDecorator } from './decorators/ReporterDecorator.js';\nimport { getListOfBlobs } from './getListOfBlobs.js';\nimport type { RemoteCacheClient } from './types/RemoteCacheClient.js';\nimport { RetryDecorator } from './decorators/RetryDecorator.js';\nimport { blockListIsInvalidRetryPolicy } from './retry/blockListIsInvalidRetryPolicy.js';\nimport { RetryManager } from '@ms-cloudpack/retry';\nimport type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';\nimport { getCredential } from './authentication/getCredential.js';\nimport type { TelemetryClient } from '@ms-cloudpack/telemetry';\nimport type { LoginMethod } from './types/LoginMethod.js';\n\nexport interface CreateRemoteCacheClientParams {\n options: {\n storageAccount: string;\n container: string;\n loginMethod: LoginMethod;\n cachePath: string;\n };\n context: {\n reporter: TaskReporter;\n telemetryClient: TelemetryClient;\n };\n}\n\nexport async function createRemoteCacheClient(params: CreateRemoteCacheClientParams): Promise<RemoteCacheClient> {\n const { context, options } = params;\n const { container, loginMethod, storageAccount, cachePath } = options;\n\n const credential = await getCredential(loginMethod, cachePath);\n\n const remoteCacheClientOptions: RemoteCacheClientOptions = {\n storageAccount,\n container,\n credential,\n };\n\n const client = new ReporterDecorator(\n new RetryDecorator({\n retryManager: new RetryManager([blockListIsInvalidRetryPolicy]),\n cacheClient: new InMemoryDecorator({\n cacheClient: new AzureRemoteCacheClient(remoteCacheClientOptions),\n getList: () => getListOfBlobs(remoteCacheClientOptions),\n }),\n }),\n context,\n );\n\n return client;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"InMemoryDecorator.d.ts","sourceRoot":"","sources":["../../src/decorators/InMemoryDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,yCAAyC,EACzC,iCAAiC,EACjC,gCAAgC,EACjC,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,qBAAa,iBAAkB,YAAW,iBAAiB;IACzD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoB;IAChD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;gBAEhC,OAAO,EAAE;QAAE,WAAW,EAAE,iBAAiB,CAAC;QAAC,OAAO,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;KAAE;IAKtF,YAAY,CAAC,OAAO,EAAE,yCAAyC,GAAG,OAAO,CAAC,gCAAgC,CAAC;IAgB3G,cAAc,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,gCAAgC,CAAC;CAQ5G"}
@@ -1,29 +0,0 @@
1
- /**
2
- * A decorator for a RemoteCacheClient that keeps a list of remote resources locally.
3
- */
4
- export class InMemoryDecorator {
5
- constructor(options) {
6
- this.cacheClient = options.cacheClient;
7
- this.list = options.getList();
8
- }
9
- async uploadFolder(options) {
10
- if ((await this.list).has(options.folderName)) {
11
- // This resource already exists in the remote cache, no need to upload it again.
12
- return 'already-exist';
13
- }
14
- const result = await this.cacheClient.uploadFolder(options);
15
- if (result === 'success') {
16
- // The upload is successful, add the resource to the list.
17
- (await this.list).add(options.folderName);
18
- }
19
- return result;
20
- }
21
- async downloadFolder(options) {
22
- if (!(await this.list).has(options.folderName)) {
23
- // This resource doesn't exist in the remote cache, can't download it.
24
- return 'not-found';
25
- }
26
- return this.cacheClient.downloadFolder(options);
27
- }
28
- }
29
- //# sourceMappingURL=InMemoryDecorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InMemoryDecorator.js","sourceRoot":"","sources":["../../src/decorators/InMemoryDecorator.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAI5B,YAAY,OAAgF;QAC1F,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAkD;QACnE,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9C,gFAAgF;YAChF,OAAO,eAAe,CAAC;QACzB,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,0DAA0D;YAC1D,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAA0C;QAC7D,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/C,sEAAsE;YACtE,OAAO,WAAW,CAAC;QACrB,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["import type {\n RemoteCacheClient,\n RemoteCacheClientDownloadOperationOptions,\n RemoteCacheClientOperationOptions,\n RemoteCacheClientOperationResult,\n} from '../types/RemoteCacheClient.js';\n\n/**\n * A decorator for a RemoteCacheClient that keeps a list of remote resources locally.\n */\nexport class InMemoryDecorator implements RemoteCacheClient {\n private readonly cacheClient: RemoteCacheClient;\n private readonly list: Promise<Set<string>>;\n\n constructor(options: { cacheClient: RemoteCacheClient; getList: () => Promise<Set<string>> }) {\n this.cacheClient = options.cacheClient;\n this.list = options.getList();\n }\n\n async uploadFolder(options: RemoteCacheClientDownloadOperationOptions): Promise<RemoteCacheClientOperationResult> {\n if ((await this.list).has(options.folderName)) {\n // This resource already exists in the remote cache, no need to upload it again.\n return 'already-exist';\n }\n\n const result = await this.cacheClient.uploadFolder(options);\n\n if (result === 'success') {\n // The upload is successful, add the resource to the list.\n (await this.list).add(options.folderName);\n }\n\n return result;\n }\n\n async downloadFolder(options: RemoteCacheClientOperationOptions): Promise<RemoteCacheClientOperationResult> {\n if (!(await this.list).has(options.folderName)) {\n // This resource doesn't exist in the remote cache, can't download it.\n return 'not-found';\n }\n\n return this.cacheClient.downloadFolder(options);\n }\n}\n"]}
@@ -1 +0,0 @@
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;IAiD/D,cAAc,CAAC,OAAO,EAAE,iCAAiC;CAiDhE"}
@@ -1,121 +0,0 @@
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
- }
18
- export class ReporterDecorator {
19
- constructor(client, context) {
20
- this.client = client;
21
- this.context = context;
22
- }
23
- buildFailureMessage({ folderName, friendlyName, path }, error) {
24
- const list = bulletedList([
25
- `FolderName: ${folderName}`,
26
- `Path: ${path}`,
27
- `Name: ${friendlyName}`,
28
- `Error: ${error instanceof Error ? error.message : '<Unknown>'}`,
29
- ]);
30
- return `\n${list}`;
31
- }
32
- async uploadFolder(options) {
33
- const { folderName, path, friendlyName } = options;
34
- const task = this.context.reporter.addTask(`Uploading to remote cache: ${friendlyName}`);
35
- let uploadResult;
36
- try {
37
- uploadResult = await this.client.uploadFolder(options);
38
- }
39
- catch (e) {
40
- if (e instanceof Error) {
41
- reportError(this.context.telemetryClient, e);
42
- }
43
- task.complete({
44
- status: 'fail',
45
- message: this.buildFailureMessage(options, e),
46
- });
47
- throw e;
48
- }
49
- const details = bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Name: ${friendlyName}`]);
50
- switch (uploadResult) {
51
- case 'success':
52
- task.complete({
53
- status: 'complete',
54
- details,
55
- });
56
- break;
57
- case 'not-found':
58
- task.complete({
59
- status: 'skip',
60
- message: `Not found in the local cache.`,
61
- details,
62
- });
63
- break;
64
- case 'already-exist':
65
- task.complete({
66
- status: 'skip',
67
- message: `Package is already exist in the remote cache.`,
68
- details,
69
- });
70
- break;
71
- default:
72
- throw new Error(`Unknown upload result: ${uploadResult}`);
73
- }
74
- return uploadResult;
75
- }
76
- async downloadFolder(options) {
77
- const { folderName, path, friendlyName } = options;
78
- const task = this.context.reporter.addTask(`Downloading from remote cache: ${friendlyName}`);
79
- let downloadResult;
80
- try {
81
- downloadResult = await this.client.downloadFolder(options);
82
- }
83
- catch (e) {
84
- if (e instanceof Error) {
85
- reportError(this.context.telemetryClient, e);
86
- }
87
- task.complete({
88
- status: 'fail',
89
- message: this.buildFailureMessage(options, e),
90
- });
91
- throw e;
92
- }
93
- const details = bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Name: ${friendlyName}`]);
94
- switch (downloadResult) {
95
- case 'success':
96
- task.complete({
97
- status: 'complete',
98
- details,
99
- });
100
- break;
101
- case 'not-found':
102
- task.complete({
103
- status: 'skip',
104
- message: `Not found in the remote cache.`,
105
- details,
106
- });
107
- break;
108
- case 'already-exist':
109
- task.complete({
110
- status: 'skip',
111
- message: `Package is already exist in the local cache.`,
112
- details,
113
- });
114
- break;
115
- default:
116
- throw new Error(`Unknown download result: ${downloadResult}`);
117
- }
118
- return downloadResult;
119
- }
120
- }
121
- //# sourceMappingURL=ReporterDecorator.js.map
@@ -1 +0,0 @@
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,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,IAAI,mBAAmB,GAAY,KAAK,CAAC;AAEzC;;;;GAIG;AACH,SAAS,WAAW,CAAC,eAAgC,EAAE,KAAY;IACjE,MAAM,WAAW,GAAG,KAAK,YAAY,SAAS,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,CAAC;IAE3E,IAAI,WAAW,IAAI,mBAAmB,EAAE,CAAC;QACvC,OAAO,CAAC,uDAAuD;IACjE,CAAC;IAED,eAAe,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAEhD,qDAAqD;IACrD,mBAAmB,GAAG,WAAW,CAAC;AACpC,CAAC;AAED,MAAM,OAAO,iBAAiB;IAC5B,YACmB,MAAyB,EACzB,OAGhB;QAJgB,WAAM,GAAN,MAAM,CAAmB;QACzB,YAAO,GAAP,OAAO,CAGvB;IACA,CAAC;IAEI,mBAAmB,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAqC,EAAE,KA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AAc,EAAE,CAAC;YACvB,KAAK,SAAS;gBACZ,IAAI,CAAC,QAAQ,CAAC;oBACZ,MAAM,EAAE,UAAU;oBAClB,OAAO;iBACR,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,WAAW;gBACd,IAAI,CAAC,QAAQ,CAAC;oBACZ,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,gCAAgC;oBACzC,OAAO;iBACR,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,eAAe;gBAClB,IAAI,CAAC,QAAQ,CAAC;oBACZ,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE,8CAA8C;oBACvD,OAAO;iBACR,CAAC,CAAC;gBACH,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,cAAc,EAAE,CAAC,CAAC;QAClE,CAAC;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 const details = bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Name: ${friendlyName}`]);\n\n switch (uploadResult) {\n case 'success':\n task.complete({\n status: 'complete',\n details,\n });\n break;\n case 'not-found':\n task.complete({\n status: 'skip',\n message: `Not found in the local cache.`,\n details,\n });\n break;\n case 'already-exist':\n task.complete({\n status: 'skip',\n message: `Package is already exist in the remote cache.`,\n details,\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 const details = bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Name: ${friendlyName}`]);\n\n switch (downloadResult) {\n case 'success':\n task.complete({\n status: 'complete',\n details,\n });\n break;\n case 'not-found':\n task.complete({\n status: 'skip',\n message: `Not found in the remote cache.`,\n details,\n });\n break;\n case 'already-exist':\n task.complete({\n status: 'skip',\n message: `Package is already exist in the local cache.`,\n details,\n });\n break;\n default:\n throw new Error(`Unknown download result: ${downloadResult}`);\n }\n\n return downloadResult;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RetryDecorator.d.ts","sourceRoot":"","sources":["../../src/decorators/RetryDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,yCAAyC,EACzC,iCAAiC,EACjC,gCAAgC,EACjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,qBAAa,cAAe,YAAW,iBAAiB;IACtD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoB;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;gBAEhC,OAAO,EAAE;QAAE,WAAW,EAAE,iBAAiB,CAAC;QAAC,YAAY,EAAE,YAAY,CAAA;KAAE;IAKnF,OAAO,CAAC,iBAAiB;IAYnB,YAAY,CAAC,OAAO,EAAE,yCAAyC,GAAG,OAAO,CAAC,gCAAgC,CAAC;IAO3G,cAAc,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,gCAAgC,CAAC;CAM5G"}
@@ -1,27 +0,0 @@
1
- /**
2
- * A decorator that retries the upload/download operation if it fails.
3
- */
4
- export class RetryDecorator {
5
- constructor(options) {
6
- this.cacheClient = options.cacheClient;
7
- this.retryManager = options.retryManager;
8
- }
9
- printRetryContext(operationName, options, retryContext) {
10
- if (retryContext) {
11
- console.warn(`Retrying ${operationName} ${options.friendlyName} ... [${retryContext.retryAttempt}/${retryContext.maxRetries}]`);
12
- }
13
- }
14
- async uploadFolder(options) {
15
- return this.retryManager.retry((retryContext) => {
16
- this.printRetryContext('upload', options, retryContext);
17
- return this.cacheClient.uploadFolder(options);
18
- });
19
- }
20
- async downloadFolder(options) {
21
- return this.retryManager.retry((retryContext) => {
22
- this.printRetryContext('download', options, retryContext);
23
- return this.cacheClient.downloadFolder(options);
24
- });
25
- }
26
- }
27
- //# sourceMappingURL=RetryDecorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RetryDecorator.js","sourceRoot":"","sources":["../../src/decorators/RetryDecorator.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,OAAO,cAAc;IAIzB,YAAY,OAAuE;QACjF,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAC3C,CAAC;IAEO,iBAAiB,CACvB,aAAqB,EACrB,OAA0C,EAC1C,YAA2D;QAE3D,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CACV,YAAY,aAAa,IAAI,OAAO,CAAC,YAAY,SAAS,YAAY,CAAC,YAAY,IAAI,YAAY,CAAC,UAAU,GAAG,CAClH,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAkD;QACnE,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,EAAE;YAC9C,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;YACxD,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAA0C;QAC7D,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,EAAE;YAC9C,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;YAC1D,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type {\n RemoteCacheClient,\n RemoteCacheClientDownloadOperationOptions,\n RemoteCacheClientOperationOptions,\n RemoteCacheClientOperationResult,\n} from '../types/RemoteCacheClient.js';\nimport type { RetryManager } from '@ms-cloudpack/retry';\n\n/**\n * A decorator that retries the upload/download operation if it fails.\n */\nexport class RetryDecorator implements RemoteCacheClient {\n private readonly cacheClient: RemoteCacheClient;\n private readonly retryManager: RetryManager;\n\n constructor(options: { cacheClient: RemoteCacheClient; retryManager: RetryManager }) {\n this.cacheClient = options.cacheClient;\n this.retryManager = options.retryManager;\n }\n\n private printRetryContext(\n operationName: string,\n options: RemoteCacheClientOperationOptions,\n retryContext?: { retryAttempt: number; maxRetries: number },\n ) {\n if (retryContext) {\n console.warn(\n `Retrying ${operationName} ${options.friendlyName} ... [${retryContext.retryAttempt}/${retryContext.maxRetries}]`,\n );\n }\n }\n\n async uploadFolder(options: RemoteCacheClientDownloadOperationOptions): Promise<RemoteCacheClientOperationResult> {\n return this.retryManager.retry((retryContext) => {\n this.printRetryContext('upload', options, retryContext);\n return this.cacheClient.uploadFolder(options);\n });\n }\n\n async downloadFolder(options: RemoteCacheClientOperationOptions): Promise<RemoteCacheClientOperationResult> {\n return this.retryManager.retry((retryContext) => {\n this.printRetryContext('download', options, retryContext);\n return this.cacheClient.downloadFolder(options);\n });\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getListOfBlobs.d.ts","sourceRoot":"","sources":["../src/getListOfBlobs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAGpF;;GAEG;AACH,wBAAsB,cAAc,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,EAAE,wBAAwB,wBAQvG"}
@@ -1,15 +0,0 @@
1
- import { createBlobStorageUrl } from './createBlobStorageUrl.js';
2
- import { BlobServiceClient } from '@azure/storage-blob';
3
- /**
4
- * Gets all the blobs in the remote cache.
5
- */
6
- export async function getListOfBlobs({ container, storageAccount, credential }) {
7
- const blobStorageClient = new BlobServiceClient(createBlobStorageUrl(storageAccount), credential);
8
- const containerClient = blobStorageClient.getContainerClient(container);
9
- const blobs = new Set();
10
- for await (const blob of containerClient.listBlobsFlat()) {
11
- blobs.add(blob.name);
12
- }
13
- return blobs;
14
- }
15
- //# sourceMappingURL=getListOfBlobs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getListOfBlobs.js","sourceRoot":"","sources":["../src/getListOfBlobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAA4B;IACtG,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,oBAAoB,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;IAClG,MAAM,eAAe,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,eAAe,CAAC,aAAa,EAAE,EAAE,CAAC;QACzD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { createBlobStorageUrl } from './createBlobStorageUrl.js';\nimport type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';\nimport { BlobServiceClient } from '@azure/storage-blob';\n\n/**\n * Gets all the blobs in the remote cache.\n */\nexport async function getListOfBlobs({ container, storageAccount, credential }: RemoteCacheClientOptions) {\n const blobStorageClient = new BlobServiceClient(createBlobStorageUrl(storageAccount), credential);\n const containerClient = blobStorageClient.getContainerClient(container);\n const blobs = new Set<string>();\n for await (const blob of containerClient.listBlobsFlat()) {\n blobs.add(blob.name);\n }\n return blobs;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,KAAK,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAE3G,YAAY,EACV,iBAAiB,EACjB,yCAAyC,EACzC,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC"}
package/lib/index.js DELETED
@@ -1,2 +0,0 @@
1
- export { createRemoteCacheClient } from './createRemoteCacheClient.js';
2
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAsC,MAAM,8BAA8B,CAAC","sourcesContent":["export { createRemoteCacheClient, type CreateRemoteCacheClientParams } from './createRemoteCacheClient.js';\n\nexport type {\n RemoteCacheClient,\n RemoteCacheClientDownloadOperationOptions,\n RemoteCacheClientOperationOptions,\n RemoteCacheClientOperationResult,\n} from './types/RemoteCacheClient.js';\nexport type { LoginMethod } from './types/LoginMethod.js';\nexport type { RemoteCacheClientOptions } from './types/RemoteCacheClientOptions.js';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"blockListIsInvalidRetryPolicy.d.ts","sourceRoot":"","sources":["../../src/retry/blockListIsInvalidRetryPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,eAAO,MAAM,6BAA6B,EAAE,WAM3C,CAAC"}
@@ -1,8 +0,0 @@
1
- export const blockListIsInvalidRetryPolicy = {
2
- maxRetries: 1,
3
- handle: (error) => {
4
- return error instanceof Error && error.message.indexOf('The specified block list is invalid.') > -1;
5
- },
6
- wait: () => 0,
7
- };
8
- //# sourceMappingURL=blockListIsInvalidRetryPolicy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blockListIsInvalidRetryPolicy.js","sourceRoot":"","sources":["../../src/retry/blockListIsInvalidRetryPolicy.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAAgB;IACxD,UAAU,EAAE,CAAC;IACb,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;QAChB,OAAO,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,sCAAsC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtG,CAAC;IACD,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;CACd,CAAC","sourcesContent":["import type { RetryPolicy } from '../types/RetryPolicy.js';\n\nexport const blockListIsInvalidRetryPolicy: RetryPolicy = {\n maxRetries: 1,\n handle: (error) => {\n return error instanceof Error && error.message.indexOf('The specified block list is invalid.') > -1;\n },\n wait: () => 0,\n};\n"]}
@@ -1,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.39.4"
9
- }
10
- ]
11
- }
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=LoginMethod.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoginMethod.js","sourceRoot":"","sources":["../../src/types/LoginMethod.ts"],"names":[],"mappings":"","sourcesContent":["export type LoginMethod = 'interactive' | 'azure-cli' | 'device-code';\n"]}
@@ -1,7 +0,0 @@
1
- export interface PackageToSync {
2
- path: string;
3
- folderName: string;
4
- packageName: string;
5
- version: string;
6
- }
7
- //# sourceMappingURL=PackageToSync.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PackageToSync.d.ts","sourceRoot":"","sources":["../../src/types/PackageToSync.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PackageToSync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PackageToSync.js","sourceRoot":"","sources":["../../src/types/PackageToSync.ts"],"names":[],"mappings":"","sourcesContent":["export interface PackageToSync {\n path: string;\n folderName: string;\n packageName: string;\n version: string;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoteCacheClient.d.ts","sourceRoot":"","sources":["../../src/types/RemoteCacheClient.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gCAAgC,GAAG,SAAS,GAAG,WAAW,GAAG,eAAe,CAAC;AAEzF,MAAM,WAAW,iCAAiC;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,yCAA0C,SAAQ,iCAAiC;IAClG,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,OAAO,EAAE,yCAAyC,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC5G,cAAc,CAAC,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;CACvG"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=RemoteCacheClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoteCacheClient.js","sourceRoot":"","sources":["../../src/types/RemoteCacheClient.ts"],"names":[],"mappings":"","sourcesContent":["export type RemoteCacheClientOperationResult = 'success' | 'not-found' | 'already-exist';\n\nexport interface RemoteCacheClientOperationOptions {\n folderName: string;\n path: string;\n friendlyName: string;\n}\n\nexport interface RemoteCacheClientDownloadOperationOptions extends RemoteCacheClientOperationOptions {\n globMatches: string[];\n}\n\nexport interface RemoteCacheClient {\n uploadFolder(options: RemoteCacheClientDownloadOperationOptions): Promise<RemoteCacheClientOperationResult>;\n downloadFolder(options: RemoteCacheClientOperationOptions): Promise<RemoteCacheClientOperationResult>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoteCacheClientOptions.d.ts","sourceRoot":"","sources":["../../src/types/RemoteCacheClientOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,eAAe,CAAC;CAC7B"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=RemoteCacheClientOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoteCacheClientOptions.js","sourceRoot":"","sources":["../../src/types/RemoteCacheClientOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { TokenCredential } from '@azure/identity';\n\nexport interface RemoteCacheClientOptions {\n storageAccount: string;\n container: string;\n credential: TokenCredential;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RetryPolicy.d.ts","sourceRoot":"","sources":["../../src/types/RetryPolicy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IAEpC;;OAEG;IACH,IAAI,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;CACxC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=RetryPolicy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RetryPolicy.js","sourceRoot":"","sources":["../../src/types/RetryPolicy.ts"],"names":[],"mappings":"","sourcesContent":["export type RetryPolicy = {\n /**\n * The maximum number of retries.\n */\n maxRetries: number;\n\n /**\n * Given the error, return true if the operation should be handled by this policy.\n */\n handle: (error: unknown) => boolean;\n\n /**\n * Given the retry attempt, return the number of milliseconds to wait before retrying.\n */\n wait: (retryAttempt: number) => number;\n};\n"]}