@azure/storage-queue 12.30.0-beta.1 → 12.31.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/browser/generated/src/storageClient.js +2 -2
  2. package/dist/browser/generated/src/storageClient.js.map +1 -1
  3. package/dist/browser/utils/constants.js +2 -2
  4. package/dist/browser/utils/constants.js.map +1 -1
  5. package/dist/browser/utils/utils.common.d.ts.map +1 -1
  6. package/dist/browser/utils/utils.common.js +14 -0
  7. package/dist/browser/utils/utils.common.js.map +1 -1
  8. package/dist/commonjs/AccountSASPermissions.js +1 -0
  9. package/dist/commonjs/AccountSASPermissions.js.map +1 -1
  10. package/dist/commonjs/AccountSASResourceTypes.js +1 -0
  11. package/dist/commonjs/AccountSASResourceTypes.js.map +1 -1
  12. package/dist/commonjs/AccountSASServices.js +1 -0
  13. package/dist/commonjs/AccountSASServices.js.map +1 -1
  14. package/dist/commonjs/AccountSASSignatureValues.js +1 -0
  15. package/dist/commonjs/AccountSASSignatureValues.js.map +1 -1
  16. package/dist/commonjs/Pipeline.js +1 -0
  17. package/dist/commonjs/Pipeline.js.map +1 -1
  18. package/dist/commonjs/QueueClient.js +1 -0
  19. package/dist/commonjs/QueueClient.js.map +1 -1
  20. package/dist/commonjs/QueueSASPermissions.js +1 -0
  21. package/dist/commonjs/QueueSASPermissions.js.map +1 -1
  22. package/dist/commonjs/QueueSASSignatureValues.js +1 -0
  23. package/dist/commonjs/QueueSASSignatureValues.js.map +1 -1
  24. package/dist/commonjs/QueueServiceClient.js +1 -0
  25. package/dist/commonjs/QueueServiceClient.js.map +1 -1
  26. package/dist/commonjs/SASQueryParameters.js +1 -0
  27. package/dist/commonjs/SASQueryParameters.js.map +1 -1
  28. package/dist/commonjs/SasIPRange.js +1 -0
  29. package/dist/commonjs/SasIPRange.js.map +1 -1
  30. package/dist/commonjs/StorageClient.js +1 -0
  31. package/dist/commonjs/StorageClient.js.map +1 -1
  32. package/dist/commonjs/StorageContextClient.js +1 -0
  33. package/dist/commonjs/StorageContextClient.js.map +1 -1
  34. package/dist/commonjs/generated/src/index.js +1 -0
  35. package/dist/commonjs/generated/src/index.js.map +1 -1
  36. package/dist/commonjs/generated/src/models/index.js +1 -0
  37. package/dist/commonjs/generated/src/models/index.js.map +1 -1
  38. package/dist/commonjs/generated/src/models/mappers.js +1 -0
  39. package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
  40. package/dist/commonjs/generated/src/models/parameters.js +1 -0
  41. package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
  42. package/dist/commonjs/generated/src/operations/index.js +1 -0
  43. package/dist/commonjs/generated/src/operations/index.js.map +1 -1
  44. package/dist/commonjs/generated/src/operations/messageId.js +1 -0
  45. package/dist/commonjs/generated/src/operations/messageId.js.map +1 -1
  46. package/dist/commonjs/generated/src/operations/messages.js +1 -0
  47. package/dist/commonjs/generated/src/operations/messages.js.map +1 -1
  48. package/dist/commonjs/generated/src/operations/queue.js +1 -0
  49. package/dist/commonjs/generated/src/operations/queue.js.map +1 -1
  50. package/dist/commonjs/generated/src/operations/service.js +1 -0
  51. package/dist/commonjs/generated/src/operations/service.js.map +1 -1
  52. package/dist/commonjs/generated/src/operationsInterfaces/index.js +1 -0
  53. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -1
  54. package/dist/commonjs/generated/src/operationsInterfaces/messageId.js +1 -0
  55. package/dist/commonjs/generated/src/operationsInterfaces/messageId.js.map +1 -1
  56. package/dist/commonjs/generated/src/operationsInterfaces/messages.js +1 -0
  57. package/dist/commonjs/generated/src/operationsInterfaces/messages.js.map +1 -1
  58. package/dist/commonjs/generated/src/operationsInterfaces/queue.js +1 -0
  59. package/dist/commonjs/generated/src/operationsInterfaces/queue.js.map +1 -1
  60. package/dist/commonjs/generated/src/operationsInterfaces/service.js +1 -0
  61. package/dist/commonjs/generated/src/operationsInterfaces/service.js.map +1 -1
  62. package/dist/commonjs/generated/src/storageClient.js +3 -2
  63. package/dist/commonjs/generated/src/storageClient.js.map +2 -2
  64. package/dist/commonjs/generatedModels.js +1 -0
  65. package/dist/commonjs/generatedModels.js.map +1 -1
  66. package/dist/commonjs/index.js +1 -0
  67. package/dist/commonjs/index.js.map +1 -1
  68. package/dist/commonjs/log.js +1 -0
  69. package/dist/commonjs/log.js.map +1 -1
  70. package/dist/commonjs/models.js +1 -0
  71. package/dist/commonjs/models.js.map +1 -1
  72. package/dist/commonjs/tsdoc-metadata.json +1 -1
  73. package/dist/commonjs/utils/constants.js +3 -2
  74. package/dist/commonjs/utils/constants.js.map +2 -2
  75. package/dist/commonjs/utils/tracing.js +1 -0
  76. package/dist/commonjs/utils/tracing.js.map +1 -1
  77. package/dist/commonjs/utils/utils.common.d.ts.map +1 -1
  78. package/dist/commonjs/utils/utils.common.js +14 -0
  79. package/dist/commonjs/utils/utils.common.js.map +3 -3
  80. package/dist/esm/AccountSASPermissions.js +123 -111
  81. package/dist/esm/AccountSASPermissions.js.map +1 -7
  82. package/dist/esm/AccountSASResourceTypes.js +67 -58
  83. package/dist/esm/AccountSASResourceTypes.js.map +1 -7
  84. package/dist/esm/AccountSASServices.js +75 -66
  85. package/dist/esm/AccountSASServices.js.map +1 -7
  86. package/dist/esm/AccountSASSignatureValues.js +63 -62
  87. package/dist/esm/AccountSASSignatureValues.js.map +1 -7
  88. package/dist/esm/Pipeline.js +239 -239
  89. package/dist/esm/Pipeline.js.map +1 -7
  90. package/dist/esm/QueueClient.js +671 -689
  91. package/dist/esm/QueueClient.js.map +1 -7
  92. package/dist/esm/QueueSASPermissions.js +77 -68
  93. package/dist/esm/QueueSASPermissions.js.map +1 -7
  94. package/dist/esm/QueueSASSignatureValues.js +103 -123
  95. package/dist/esm/QueueSASSignatureValues.js.map +1 -7
  96. package/dist/esm/QueueServiceClient.js +463 -505
  97. package/dist/esm/QueueServiceClient.js.map +1 -7
  98. package/dist/esm/SASQueryParameters.js +272 -283
  99. package/dist/esm/SASQueryParameters.js.map +1 -7
  100. package/dist/esm/SasIPRange.js +12 -5
  101. package/dist/esm/SasIPRange.js.map +1 -7
  102. package/dist/esm/StorageClient.js +59 -50
  103. package/dist/esm/StorageClient.js.map +1 -7
  104. package/dist/esm/StorageContextClient.js +15 -10
  105. package/dist/esm/StorageContextClient.js.map +1 -7
  106. package/dist/esm/generated/src/index.js +9 -4
  107. package/dist/esm/generated/src/index.js.map +1 -7
  108. package/dist/esm/generated/src/models/index.js +126 -63
  109. package/dist/esm/generated/src/models/index.js.map +1 -7
  110. package/dist/esm/generated/src/models/mappers.js +1827 -1873
  111. package/dist/esm/generated/src/models/mappers.js.map +1 -7
  112. package/dist/esm/generated/src/models/parameters.js +302 -330
  113. package/dist/esm/generated/src/models/parameters.js.map +1 -7
  114. package/dist/esm/generated/src/operations/index.js +8 -0
  115. package/dist/esm/generated/src/operations/index.js.map +1 -7
  116. package/dist/esm/generated/src/operations/messageId.js +92 -95
  117. package/dist/esm/generated/src/operations/messageId.js.map +1 -7
  118. package/dist/esm/generated/src/operations/messages.js +178 -178
  119. package/dist/esm/generated/src/operations/messages.js.map +1 -7
  120. package/dist/esm/generated/src/operations/queue.js +199 -208
  121. package/dist/esm/generated/src/operations/queue.js.map +1 -7
  122. package/dist/esm/generated/src/operations/service.js +192 -204
  123. package/dist/esm/generated/src/operations/service.js.map +1 -7
  124. package/dist/esm/generated/src/operationsInterfaces/index.js +8 -0
  125. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -7
  126. package/dist/esm/generated/src/operationsInterfaces/messageId.js +9 -0
  127. package/dist/esm/generated/src/operationsInterfaces/messageId.js.map +1 -7
  128. package/dist/esm/generated/src/operationsInterfaces/messages.js +9 -0
  129. package/dist/esm/generated/src/operationsInterfaces/messages.js.map +1 -7
  130. package/dist/esm/generated/src/operationsInterfaces/queue.js +9 -0
  131. package/dist/esm/generated/src/operationsInterfaces/queue.js.map +1 -7
  132. package/dist/esm/generated/src/operationsInterfaces/service.js +9 -0
  133. package/dist/esm/generated/src/operationsInterfaces/service.js.map +1 -7
  134. package/dist/esm/generated/src/storageClient.js +54 -49
  135. package/dist/esm/generated/src/storageClient.js.map +1 -7
  136. package/dist/esm/generatedModels.js +4 -0
  137. package/dist/esm/generatedModels.js.map +1 -7
  138. package/dist/esm/index.js +10 -50
  139. package/dist/esm/index.js.map +1 -7
  140. package/dist/esm/log.js +7 -4
  141. package/dist/esm/log.js.map +1 -7
  142. package/dist/esm/models.js +18 -10
  143. package/dist/esm/models.js.map +1 -7
  144. package/dist/esm/utils/constants.js +111 -117
  145. package/dist/esm/utils/constants.js.map +1 -7
  146. package/dist/esm/utils/tracing.js +11 -7
  147. package/dist/esm/utils/tracing.js.map +1 -7
  148. package/dist/esm/utils/utils.common.d.ts.map +1 -1
  149. package/dist/esm/utils/utils.common.js +372 -247
  150. package/dist/esm/utils/utils.common.js.map +1 -7
  151. package/dist/react-native/generated/src/storageClient.js +2 -2
  152. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  153. package/dist/react-native/utils/constants.js +2 -2
  154. package/dist/react-native/utils/constants.js.map +1 -1
  155. package/dist/react-native/utils/utils.common.d.ts.map +1 -1
  156. package/dist/react-native/utils/utils.common.js +14 -0
  157. package/dist/react-native/utils/utils.common.js.map +1 -1
  158. package/package.json +13 -9
@@ -1,271 +1,271 @@
1
- import {
2
- convertHttpClient,
3
- createRequestPolicyFactoryPolicy
4
- } from "@azure/core-http-compat";
5
- import {
6
- bearerTokenAuthenticationPolicy,
7
- decompressResponsePolicyName
8
- } from "@azure/core-rest-pipeline";
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { convertHttpClient, createRequestPolicyFactoryPolicy, } from "@azure/core-http-compat";
4
+ import { bearerTokenAuthenticationPolicy, decompressResponsePolicyName, } from "@azure/core-rest-pipeline";
9
5
  import { authorizeRequestOnTenantChallenge, createClientPipeline } from "@azure/core-client";
10
6
  import { parseXML, stringifyXML } from "@azure/core-xml";
11
7
  import { isTokenCredential } from "@azure/core-auth";
12
8
  import { logger } from "./log.js";
13
- import {
14
- StorageRetryPolicyFactory,
15
- StorageSharedKeyCredential,
16
- AnonymousCredential,
17
- getCachedDefaultHttpClient,
18
- storageBrowserPolicy,
19
- storageRetryPolicy,
20
- storageSharedKeyCredentialPolicy,
21
- StorageBrowserPolicyFactory,
22
- storageCorrectContentLengthPolicy,
23
- storageRequestFailureDetailsParserPolicy
24
- } from "@azure/storage-common";
25
- import {
26
- StorageOAuthScopes,
27
- StorageQueueLoggingAllowedHeaderNames,
28
- StorageQueueLoggingAllowedQueryParameters,
29
- SDK_VERSION
30
- } from "./utils/constants.js";
31
- function isPipelineLike(pipeline) {
32
- if (!pipeline || typeof pipeline !== "object") {
33
- return false;
34
- }
35
- const castPipeline = pipeline;
36
- return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function";
9
+ import { StorageRetryPolicyFactory, StorageSharedKeyCredential, AnonymousCredential, getCachedDefaultHttpClient, storageBrowserPolicy, storageRetryPolicy, storageSharedKeyCredentialPolicy, StorageBrowserPolicyFactory, storageCorrectContentLengthPolicy, storageRequestFailureDetailsParserPolicy, } from "@azure/storage-common";
10
+ import { StorageOAuthScopes, StorageQueueLoggingAllowedHeaderNames, StorageQueueLoggingAllowedQueryParameters, SDK_VERSION, } from "./utils/constants.js";
11
+ // Export following interfaces and types for customers who want to implement their
12
+ // own RequestPolicy or HTTPClient
13
+ export { StorageOAuthScopes, };
14
+ /**
15
+ * A helper to decide if a given argument satisfies the Pipeline contract
16
+ * @param pipeline - An argument that may be a Pipeline
17
+ * @returns true when the argument satisfies the Pipeline contract
18
+ */
19
+ export function isPipelineLike(pipeline) {
20
+ if (!pipeline || typeof pipeline !== "object") {
21
+ return false;
22
+ }
23
+ const castPipeline = pipeline;
24
+ return (Array.isArray(castPipeline.factories) &&
25
+ typeof castPipeline.options === "object" &&
26
+ typeof castPipeline.toServiceClientOptions === "function");
37
27
  }
38
- class Pipeline {
39
- /**
40
- * A list of chained request policy factories.
41
- */
42
- factories;
43
- /**
44
- * Configures pipeline logger and HTTP client.
45
- */
46
- options;
47
- /**
48
- * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.
49
- *
50
- * @param factories -
51
- * @param options -
52
- */
53
- constructor(factories, options = {}) {
54
- this.factories = factories;
55
- this.options = options;
56
- }
57
- /**
58
- * Transfer Pipeline object to ServiceClientOptions object which is required by
59
- * ServiceClient constructor.
60
- *
61
- * @returns The ServiceClientOptions object from this Pipeline.
62
- */
63
- toServiceClientOptions() {
64
- return {
65
- httpClient: this.options.httpClient,
66
- requestPolicyFactories: this.factories
67
- };
68
- }
28
+ /**
29
+ * A Pipeline class containing HTTP request policies.
30
+ * You can create a default Pipeline by calling {@link newPipeline}.
31
+ * Or you can create a Pipeline with your own policies by the constructor of Pipeline.
32
+ *
33
+ * Refer to {@link newPipeline} and provided policies before implementing your
34
+ * customized Pipeline.
35
+ */
36
+ export class Pipeline {
37
+ /**
38
+ * A list of chained request policy factories.
39
+ */
40
+ factories;
41
+ /**
42
+ * Configures pipeline logger and HTTP client.
43
+ */
44
+ options;
45
+ /**
46
+ * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.
47
+ *
48
+ * @param factories -
49
+ * @param options -
50
+ */
51
+ constructor(factories, options = {}) {
52
+ this.factories = factories;
53
+ this.options = options;
54
+ }
55
+ /**
56
+ * Transfer Pipeline object to ServiceClientOptions object which is required by
57
+ * ServiceClient constructor.
58
+ *
59
+ * @returns The ServiceClientOptions object from this Pipeline.
60
+ */
61
+ toServiceClientOptions() {
62
+ return {
63
+ httpClient: this.options.httpClient,
64
+ requestPolicyFactories: this.factories,
65
+ };
66
+ }
69
67
  }
70
- function newPipeline(credential, pipelineOptions = {}) {
71
- if (!credential) {
72
- credential = new AnonymousCredential();
73
- }
74
- const pipeline = new Pipeline([], pipelineOptions);
75
- pipeline._credential = credential;
76
- return pipeline;
68
+ /**
69
+ * Creates a new Pipeline object with Credential provided.
70
+ *
71
+ * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
72
+ * @param pipelineOptions - Optional. Options.
73
+ * @returns A new Pipeline object.
74
+ */
75
+ export function newPipeline(credential, pipelineOptions = {}) {
76
+ if (!credential) {
77
+ credential = new AnonymousCredential();
78
+ }
79
+ const pipeline = new Pipeline([], pipelineOptions);
80
+ pipeline._credential = credential;
81
+ return pipeline;
77
82
  }
78
83
  function processDownlevelPipeline(pipeline) {
79
- const knownFactoryFunctions = [
80
- isAnonymousCredential,
81
- isStorageSharedKeyCredential,
82
- isCoreHttpBearerTokenFactory,
83
- isStorageBrowserPolicyFactory,
84
- isStorageRetryPolicyFactory,
85
- isStorageTelemetryPolicyFactory,
86
- isCoreHttpPolicyFactory
87
- ];
88
- if (pipeline.factories.length) {
89
- const novelFactories = pipeline.factories.filter((factory) => {
90
- return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));
91
- });
92
- if (novelFactories.length) {
93
- const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));
94
- return {
95
- wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),
96
- afterRetry: hasInjector
97
- };
84
+ const knownFactoryFunctions = [
85
+ isAnonymousCredential,
86
+ isStorageSharedKeyCredential,
87
+ isCoreHttpBearerTokenFactory,
88
+ isStorageBrowserPolicyFactory,
89
+ isStorageRetryPolicyFactory,
90
+ isStorageTelemetryPolicyFactory,
91
+ isCoreHttpPolicyFactory,
92
+ ];
93
+ if (pipeline.factories.length) {
94
+ const novelFactories = pipeline.factories.filter((factory) => {
95
+ return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));
96
+ });
97
+ if (novelFactories.length) {
98
+ const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));
99
+ // if there are any left over, wrap in a requestPolicyFactoryPolicy
100
+ return {
101
+ wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),
102
+ afterRetry: hasInjector,
103
+ };
104
+ }
98
105
  }
99
- }
100
- return void 0;
106
+ return undefined;
101
107
  }
102
- function getCoreClientOptions(pipeline) {
103
- const { httpClient: v1Client, ...restOptions } = pipeline.options;
104
- let httpClient = pipeline._coreHttpClient;
105
- if (!httpClient) {
106
- httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();
107
- pipeline._coreHttpClient = httpClient;
108
- }
109
- let corePipeline = pipeline._corePipeline;
110
- if (!corePipeline) {
111
- const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;
112
- const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`;
113
- corePipeline = createClientPipeline({
114
- ...restOptions,
115
- loggingOptions: {
116
- additionalAllowedHeaderNames: StorageQueueLoggingAllowedHeaderNames,
117
- additionalAllowedQueryParameters: StorageQueueLoggingAllowedQueryParameters,
118
- logger: logger.info
119
- },
120
- userAgentOptions: {
121
- userAgentPrefix
122
- },
123
- serializationOptions: {
124
- stringifyXML,
125
- serializerOptions: {
126
- xml: {
127
- // Use customized XML char key of "#" so we can deserialize metadata
128
- // with "_" key
129
- xmlCharKey: "#"
130
- }
108
+ export function getCoreClientOptions(pipeline) {
109
+ const { httpClient: v1Client, ...restOptions } = pipeline.options;
110
+ let httpClient = pipeline._coreHttpClient;
111
+ if (!httpClient) {
112
+ httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();
113
+ pipeline._coreHttpClient = httpClient;
114
+ }
115
+ let corePipeline = pipeline._corePipeline;
116
+ if (!corePipeline) {
117
+ const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;
118
+ const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix
119
+ ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`
120
+ : `${packageDetails}`;
121
+ corePipeline = createClientPipeline({
122
+ ...restOptions,
123
+ loggingOptions: {
124
+ additionalAllowedHeaderNames: StorageQueueLoggingAllowedHeaderNames,
125
+ additionalAllowedQueryParameters: StorageQueueLoggingAllowedQueryParameters,
126
+ logger: logger.info,
127
+ },
128
+ userAgentOptions: {
129
+ userAgentPrefix,
130
+ },
131
+ serializationOptions: {
132
+ stringifyXML,
133
+ serializerOptions: {
134
+ xml: {
135
+ // Use customized XML char key of "#" so we can deserialize metadata
136
+ // with "_" key
137
+ xmlCharKey: "#",
138
+ },
139
+ },
140
+ },
141
+ deserializationOptions: {
142
+ parseXML,
143
+ serializerOptions: {
144
+ xml: {
145
+ // Use customized XML char key of "#" so we can deserialize metadata
146
+ // with "_" key
147
+ xmlCharKey: "#",
148
+ },
149
+ },
150
+ },
151
+ });
152
+ corePipeline.removePolicy({ phase: "Retry" });
153
+ corePipeline.removePolicy({ name: decompressResponsePolicyName });
154
+ corePipeline.addPolicy(storageCorrectContentLengthPolicy());
155
+ corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" });
156
+ corePipeline.addPolicy(storageRequestFailureDetailsParserPolicy());
157
+ corePipeline.addPolicy(storageBrowserPolicy());
158
+ const downlevelResults = processDownlevelPipeline(pipeline);
159
+ if (downlevelResults) {
160
+ corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : undefined);
131
161
  }
132
- },
133
- deserializationOptions: {
134
- parseXML,
135
- serializerOptions: {
136
- xml: {
137
- // Use customized XML char key of "#" so we can deserialize metadata
138
- // with "_" key
139
- xmlCharKey: "#"
140
- }
162
+ const credential = getCredentialFromPipeline(pipeline);
163
+ if (isTokenCredential(credential)) {
164
+ corePipeline.addPolicy(bearerTokenAuthenticationPolicy({
165
+ credential,
166
+ scopes: restOptions.audience ?? StorageOAuthScopes,
167
+ challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },
168
+ }), { phase: "Sign" });
141
169
  }
142
- }
143
- });
144
- corePipeline.removePolicy({ phase: "Retry" });
145
- corePipeline.removePolicy({ name: decompressResponsePolicyName });
146
- corePipeline.addPolicy(storageCorrectContentLengthPolicy());
147
- corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" });
148
- corePipeline.addPolicy(storageRequestFailureDetailsParserPolicy());
149
- corePipeline.addPolicy(storageBrowserPolicy());
150
- const downlevelResults = processDownlevelPipeline(pipeline);
151
- if (downlevelResults) {
152
- corePipeline.addPolicy(
153
- downlevelResults.wrappedPolicies,
154
- downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0
155
- );
156
- }
157
- const credential = getCredentialFromPipeline(pipeline);
158
- if (isTokenCredential(credential)) {
159
- corePipeline.addPolicy(
160
- bearerTokenAuthenticationPolicy({
161
- credential,
162
- scopes: restOptions.audience ?? StorageOAuthScopes,
163
- challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge }
164
- }),
165
- { phase: "Sign" }
166
- );
167
- } else if (credential instanceof StorageSharedKeyCredential) {
168
- corePipeline.addPolicy(
169
- storageSharedKeyCredentialPolicy({
170
- accountName: credential.accountName,
171
- accountKey: credential.accountKey
172
- }),
173
- { phase: "Sign" }
174
- );
170
+ else if (credential instanceof StorageSharedKeyCredential) {
171
+ corePipeline.addPolicy(storageSharedKeyCredentialPolicy({
172
+ accountName: credential.accountName,
173
+ accountKey: credential.accountKey,
174
+ }), { phase: "Sign" });
175
+ }
176
+ pipeline._corePipeline = corePipeline;
175
177
  }
176
- pipeline._corePipeline = corePipeline;
177
- }
178
- return {
179
- ...restOptions,
180
- allowInsecureConnection: true,
181
- httpClient,
182
- pipeline: corePipeline
183
- };
178
+ return {
179
+ ...restOptions,
180
+ allowInsecureConnection: true,
181
+ httpClient,
182
+ pipeline: corePipeline,
183
+ };
184
184
  }
185
- function getCredentialFromPipeline(pipeline) {
186
- if (pipeline._credential) {
187
- return pipeline._credential;
188
- }
189
- let credential = new AnonymousCredential();
190
- for (const factory of pipeline.factories) {
191
- if (isTokenCredential(factory.credential)) {
192
- credential = factory.credential;
193
- } else if (isStorageSharedKeyCredential(factory)) {
194
- return factory;
185
+ export function getCredentialFromPipeline(pipeline) {
186
+ // see if we squirreled one away on the type itself
187
+ if (pipeline._credential) {
188
+ return pipeline._credential;
189
+ }
190
+ // if it came from another package, loop over the factories and look for one like before
191
+ let credential = new AnonymousCredential();
192
+ for (const factory of pipeline.factories) {
193
+ if (isTokenCredential(factory.credential)) {
194
+ // Only works if the factory has been attached a "credential" property.
195
+ // We do that in newPipeline() when using TokenCredential.
196
+ credential = factory.credential;
197
+ }
198
+ else if (isStorageSharedKeyCredential(factory)) {
199
+ return factory;
200
+ }
195
201
  }
196
- }
197
- return credential;
202
+ return credential;
198
203
  }
199
204
  function isStorageSharedKeyCredential(factory) {
200
- if (factory instanceof StorageSharedKeyCredential) {
201
- return true;
202
- }
203
- return factory.constructor.name === "StorageSharedKeyCredential";
205
+ if (factory instanceof StorageSharedKeyCredential) {
206
+ return true;
207
+ }
208
+ return factory.constructor.name === "StorageSharedKeyCredential";
204
209
  }
205
210
  function isAnonymousCredential(factory) {
206
- if (factory instanceof AnonymousCredential) {
207
- return true;
208
- }
209
- return factory.constructor.name === "AnonymousCredential";
211
+ if (factory instanceof AnonymousCredential) {
212
+ return true;
213
+ }
214
+ return factory.constructor.name === "AnonymousCredential";
210
215
  }
211
216
  function isCoreHttpBearerTokenFactory(factory) {
212
- return isTokenCredential(factory.credential);
217
+ return isTokenCredential(factory.credential);
213
218
  }
214
219
  function isStorageBrowserPolicyFactory(factory) {
215
- if (factory instanceof StorageBrowserPolicyFactory) {
216
- return true;
217
- }
218
- return factory.constructor.name === "StorageBrowserPolicyFactory";
220
+ if (factory instanceof StorageBrowserPolicyFactory) {
221
+ return true;
222
+ }
223
+ return factory.constructor.name === "StorageBrowserPolicyFactory";
219
224
  }
220
225
  function isStorageRetryPolicyFactory(factory) {
221
- if (factory instanceof StorageRetryPolicyFactory) {
222
- return true;
223
- }
224
- return factory.constructor.name === "StorageRetryPolicyFactory";
226
+ if (factory instanceof StorageRetryPolicyFactory) {
227
+ return true;
228
+ }
229
+ return factory.constructor.name === "StorageRetryPolicyFactory";
225
230
  }
226
231
  function isStorageTelemetryPolicyFactory(factory) {
227
- return factory.constructor.name === "TelemetryPolicyFactory";
232
+ return factory.constructor.name === "TelemetryPolicyFactory";
228
233
  }
229
234
  function isInjectorPolicyFactory(factory) {
230
- return factory.constructor.name === "InjectorPolicyFactory";
235
+ return factory.constructor.name === "InjectorPolicyFactory";
231
236
  }
232
237
  function isCoreHttpPolicyFactory(factory) {
233
- const knownPolicies = [
234
- "GenerateClientRequestIdPolicy",
235
- "TracingPolicy",
236
- "LogPolicy",
237
- "ProxyPolicy",
238
- "DisableResponseDecompressionPolicy",
239
- "KeepAlivePolicy",
240
- "DeserializationPolicy"
241
- ];
242
- const mockHttpClient = {
243
- sendRequest: async (request) => {
244
- return {
245
- request,
246
- headers: request.headers.clone(),
247
- status: 500
248
- };
249
- }
250
- };
251
- const mockRequestPolicyOptions = {
252
- log(_logLevel, _message) {
253
- },
254
- shouldLog(_logLevel) {
255
- return false;
256
- }
257
- };
258
- const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);
259
- const policyName = policyInstance.constructor.name;
260
- return knownPolicies.some((knownPolicyName) => {
261
- return policyName.startsWith(knownPolicyName);
262
- });
238
+ const knownPolicies = [
239
+ "GenerateClientRequestIdPolicy",
240
+ "TracingPolicy",
241
+ "LogPolicy",
242
+ "ProxyPolicy",
243
+ "DisableResponseDecompressionPolicy",
244
+ "KeepAlivePolicy",
245
+ "DeserializationPolicy",
246
+ ];
247
+ const mockHttpClient = {
248
+ sendRequest: async (request) => {
249
+ return {
250
+ request,
251
+ headers: request.headers.clone(),
252
+ status: 500,
253
+ };
254
+ },
255
+ };
256
+ const mockRequestPolicyOptions = {
257
+ log(_logLevel, _message) {
258
+ /* do nothing */
259
+ },
260
+ shouldLog(_logLevel) {
261
+ return false;
262
+ },
263
+ };
264
+ const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);
265
+ const policyName = policyInstance.constructor.name;
266
+ // bundlers sometimes add a custom suffix to the class name to make it unique
267
+ return knownPolicies.some((knownPolicyName) => {
268
+ return policyName.startsWith(knownPolicyName);
269
+ });
263
270
  }
264
- export {
265
- Pipeline,
266
- StorageOAuthScopes,
267
- getCoreClientOptions,
268
- getCredentialFromPipeline,
269
- isPipelineLike,
270
- newPipeline
271
- };
271
+ //# sourceMappingURL=Pipeline.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/storage/storage-queue/src/Pipeline.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n} from \"@azure/core-http-compat\";\nimport type {\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n Pipeline as CorePipeline,\n PipelinePolicy,\n HttpClient,\n RequestBodyType as HttpRequestBody,\n} from \"@azure/core-rest-pipeline\";\nimport {\n bearerTokenAuthenticationPolicy,\n decompressResponsePolicyName,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./log.js\";\nimport type { StorageRetryOptions } from \"@azure/storage-common\";\nimport {\n StorageRetryPolicyFactory,\n StorageSharedKeyCredential,\n AnonymousCredential,\n getCachedDefaultHttpClient,\n storageBrowserPolicy,\n storageRetryPolicy,\n storageSharedKeyCredentialPolicy,\n StorageBrowserPolicyFactory,\n storageCorrectContentLengthPolicy,\n storageRequestFailureDetailsParserPolicy,\n} from \"@azure/storage-common\";\nimport {\n StorageOAuthScopes,\n StorageQueueLoggingAllowedHeaderNames,\n StorageQueueLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants.js\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n type IHttpClient,\n type HttpHeaders,\n type HttpRequestBody,\n type HttpOperationResponse,\n type WebResource,\n type RequestPolicyFactory,\n type RequestPolicy,\n type RequestPolicyOptions,\n};\n\n/**\n * A subset of `@azure/core-http` ServiceClientOptions\n */\nexport interface ServiceClientOptions {\n /**\n * Optional. Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * Optional. Overrides the default policy factories.\n */\n requestPolicyFactories?:\n | RequestPolicyFactory[]\n | ((defaultRequestPolicyFactories: RequestPolicyFactory[]) => void | RequestPolicyFactory[]);\n}\n\n/**\n * Option interface for Pipeline constructor.\n */\nexport interface PipelineOptions {\n /**\n * Optional. Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n}\n\n/**\n * An interface for the {@link Pipeline} class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport interface PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n readonly options: PipelineOptions;\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n toServiceClientOptions(): ServiceClientOptions;\n}\n\n/**\n * A helper to decide if a given argument satisfies the Pipeline contract\n * @param pipeline - An argument that may be a Pipeline\n * @returns true when the argument satisfies the Pipeline contract\n */\nexport function isPipelineLike(pipeline: unknown): pipeline is PipelineLike {\n if (!pipeline || typeof pipeline !== \"object\") {\n return false;\n }\n\n const castPipeline = pipeline as PipelineLike;\n\n return (\n Array.isArray(castPipeline.factories) &&\n typeof castPipeline.options === \"object\" &&\n typeof castPipeline.toServiceClientOptions === \"function\"\n );\n}\n\n/**\n * A Pipeline class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport class Pipeline implements PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n public readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n public readonly options: PipelineOptions;\n\n /**\n * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.\n *\n * @param factories -\n * @param options -\n */\n constructor(factories: RequestPolicyFactory[], options: PipelineOptions = {}) {\n this.factories = factories;\n this.options = options;\n }\n\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n public toServiceClientOptions(): ServiceClientOptions {\n return {\n httpClient: this.options.httpClient,\n requestPolicyFactories: this.factories,\n };\n }\n}\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string;\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageQueueLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageQueueLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageRequestFailureDetailsParserPolicy());\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"],
5
- "mappings": "AAQA;AAAA,EAQE;AAAA,EACA;AAAA,OACK;AASP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,mCAAmC,4BAA4B;AACxE,SAAS,UAAU,oBAAoB;AAEvC,SAAS,yBAAyB;AAElC,SAAS,cAAc;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAyEA,SAAS,eAAe,UAA6C;AAC1E,MAAI,CAAC,YAAY,OAAO,aAAa,UAAU;AAC7C,WAAO;AAAA,EACT;AAEA,QAAM,eAAe;AAErB,SACE,MAAM,QAAQ,aAAa,SA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,CAAC,eAAe,EAAE,EAAE;QAC5C,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n} from \"@azure/core-http-compat\";\nimport type {\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n Pipeline as CorePipeline,\n PipelinePolicy,\n HttpClient,\n RequestBodyType as HttpRequestBody,\n} from \"@azure/core-rest-pipeline\";\nimport {\n bearerTokenAuthenticationPolicy,\n decompressResponsePolicyName,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./log.js\";\nimport type { StorageRetryOptions } from \"@azure/storage-common\";\nimport {\n StorageRetryPolicyFactory,\n StorageSharedKeyCredential,\n AnonymousCredential,\n getCachedDefaultHttpClient,\n storageBrowserPolicy,\n storageRetryPolicy,\n storageSharedKeyCredentialPolicy,\n StorageBrowserPolicyFactory,\n storageCorrectContentLengthPolicy,\n storageRequestFailureDetailsParserPolicy,\n} from \"@azure/storage-common\";\nimport {\n StorageOAuthScopes,\n StorageQueueLoggingAllowedHeaderNames,\n StorageQueueLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants.js\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n type IHttpClient,\n type HttpHeaders,\n type HttpRequestBody,\n type HttpOperationResponse,\n type WebResource,\n type RequestPolicyFactory,\n type RequestPolicy,\n type RequestPolicyOptions,\n};\n\n/**\n * A subset of `@azure/core-http` ServiceClientOptions\n */\nexport interface ServiceClientOptions {\n /**\n * Optional. Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * Optional. Overrides the default policy factories.\n */\n requestPolicyFactories?:\n | RequestPolicyFactory[]\n | ((defaultRequestPolicyFactories: RequestPolicyFactory[]) => void | RequestPolicyFactory[]);\n}\n\n/**\n * Option interface for Pipeline constructor.\n */\nexport interface PipelineOptions {\n /**\n * Optional. Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n}\n\n/**\n * An interface for the {@link Pipeline} class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport interface PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n readonly options: PipelineOptions;\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n toServiceClientOptions(): ServiceClientOptions;\n}\n\n/**\n * A helper to decide if a given argument satisfies the Pipeline contract\n * @param pipeline - An argument that may be a Pipeline\n * @returns true when the argument satisfies the Pipeline contract\n */\nexport function isPipelineLike(pipeline: unknown): pipeline is PipelineLike {\n if (!pipeline || typeof pipeline !== \"object\") {\n return false;\n }\n\n const castPipeline = pipeline as PipelineLike;\n\n return (\n Array.isArray(castPipeline.factories) &&\n typeof castPipeline.options === \"object\" &&\n typeof castPipeline.toServiceClientOptions === \"function\"\n );\n}\n\n/**\n * A Pipeline class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nexport class Pipeline implements PipelineLike {\n /**\n * A list of chained request policy factories.\n */\n public readonly factories: RequestPolicyFactory[];\n /**\n * Configures pipeline logger and HTTP client.\n */\n public readonly options: PipelineOptions;\n\n /**\n * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.\n *\n * @param factories -\n * @param options -\n */\n constructor(factories: RequestPolicyFactory[], options: PipelineOptions = {}) {\n this.factories = factories;\n this.options = options;\n }\n\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n public toServiceClientOptions(): ServiceClientOptions {\n return {\n httpClient: this.options.httpClient,\n requestPolicyFactories: this.factories,\n };\n }\n}\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string;\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageQueueLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageQueueLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageRequestFailureDetailsParserPolicy());\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"]}