@azure/storage-common 12.2.0 → 12.3.1-alpha.20260203.6

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 (74) hide show
  1. package/dist/browser/StorageRetryPolicyFactory.d.ts +2 -2
  2. package/dist/browser/StorageRetryPolicyFactory.d.ts.map +1 -1
  3. package/dist/browser/StorageRetryPolicyFactory.js +2 -2
  4. package/dist/browser/StorageRetryPolicyFactory.js.map +1 -1
  5. package/dist/browser/index-browser.d.mts.map +1 -1
  6. package/dist/browser/index-browser.mjs.map +1 -1
  7. package/dist/browser/index.d.ts +0 -4
  8. package/dist/browser/index.js +0 -4
  9. package/dist/browser/interfaces.d.ts +12 -0
  10. package/dist/browser/interfaces.d.ts.map +1 -0
  11. package/dist/browser/interfaces.js +4 -0
  12. package/dist/browser/interfaces.js.map +1 -0
  13. package/dist/commonjs/StorageRetryPolicyFactory.d.ts +2 -2
  14. package/dist/commonjs/StorageRetryPolicyFactory.d.ts.map +1 -1
  15. package/dist/commonjs/StorageRetryPolicyFactory.js +2 -1
  16. package/dist/commonjs/StorageRetryPolicyFactory.js.map +1 -1
  17. package/dist/commonjs/index.d.ts +1 -4
  18. package/dist/commonjs/index.d.ts.map +1 -1
  19. package/dist/commonjs/index.js +1 -4
  20. package/dist/commonjs/index.js.map +1 -1
  21. package/dist/commonjs/interfaces.d.ts +12 -0
  22. package/dist/commonjs/interfaces.d.ts.map +1 -0
  23. package/dist/commonjs/interfaces.js +5 -0
  24. package/dist/commonjs/interfaces.js.map +1 -0
  25. package/dist/commonjs/tsdoc-metadata.json +1 -1
  26. package/dist/esm/StorageRetryPolicyFactory.d.ts +2 -2
  27. package/dist/esm/StorageRetryPolicyFactory.d.ts.map +1 -1
  28. package/dist/esm/StorageRetryPolicyFactory.js +2 -2
  29. package/dist/esm/StorageRetryPolicyFactory.js.map +1 -1
  30. package/dist/esm/index.d.ts +1 -4
  31. package/dist/esm/index.d.ts.map +1 -1
  32. package/dist/esm/index.js +1 -4
  33. package/dist/esm/index.js.map +1 -1
  34. package/dist/esm/interfaces.d.ts +12 -0
  35. package/dist/esm/interfaces.d.ts.map +1 -0
  36. package/dist/esm/interfaces.js +4 -0
  37. package/dist/esm/interfaces.js.map +1 -0
  38. package/dist/react-native/BufferScheduler-react-native.d.mts.map +1 -0
  39. package/dist/react-native/BufferScheduler-react-native.mjs.map +1 -0
  40. package/dist/react-native/BufferScheduler.d.ts +1 -155
  41. package/dist/react-native/BufferScheduler.js +4 -274
  42. package/dist/react-native/StorageRetryPolicyFactory.d.ts +2 -2
  43. package/dist/react-native/StorageRetryPolicyFactory.d.ts.map +1 -1
  44. package/dist/react-native/StorageRetryPolicyFactory.js +2 -2
  45. package/dist/react-native/StorageRetryPolicyFactory.js.map +1 -1
  46. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.d.mts.map +1 -0
  47. package/dist/react-native/credentials/StorageSharedKeyCredential-react-native.mjs.map +1 -0
  48. package/dist/react-native/credentials/StorageSharedKeyCredential.d.ts +2 -37
  49. package/dist/react-native/credentials/StorageSharedKeyCredential.js +2 -45
  50. package/dist/react-native/credentials/UserDelegationKeyCredential-react-native.d.mts.map +1 -0
  51. package/dist/react-native/credentials/UserDelegationKeyCredential-react-native.mjs.map +1 -0
  52. package/dist/react-native/credentials/UserDelegationKeyCredential.d.ts +1 -64
  53. package/dist/react-native/credentials/UserDelegationKeyCredential.js +1 -39
  54. package/dist/react-native/index.d.ts +1 -4
  55. package/dist/react-native/index.d.ts.map +1 -1
  56. package/dist/react-native/index.js +1 -4
  57. package/dist/react-native/index.js.map +1 -1
  58. package/dist/react-native/interfaces.d.ts +12 -0
  59. package/dist/react-native/interfaces.d.ts.map +1 -0
  60. package/dist/react-native/interfaces.js +4 -0
  61. package/dist/react-native/interfaces.js.map +1 -0
  62. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.d.mts.map +1 -0
  63. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs.map +1 -0
  64. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.d.ts +2 -2
  65. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js +2 -116
  66. package/package.json +11 -11
  67. package/dist/react-native/BufferScheduler.d.ts.map +0 -1
  68. package/dist/react-native/BufferScheduler.js.map +0 -1
  69. package/dist/react-native/credentials/StorageSharedKeyCredential.d.ts.map +0 -1
  70. package/dist/react-native/credentials/StorageSharedKeyCredential.js.map +0 -1
  71. package/dist/react-native/credentials/UserDelegationKeyCredential.d.ts.map +0 -1
  72. package/dist/react-native/credentials/UserDelegationKeyCredential.js.map +0 -1
  73. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.d.ts.map +0 -1
  74. package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js.map +0 -1
@@ -1,157 +1,3 @@
1
- /**
2
- * OutgoingHandler is an async function triggered by BufferScheduler.
3
- */
4
- export declare type OutgoingHandler = (body: () => NodeJS.ReadableStream, length: number, offset?: number) => Promise<any>;
5
- /**
6
- * This class accepts a Node.js Readable stream as input, and keeps reading data
7
- * from the stream into the internal buffer structure, until it reaches maxBuffers.
8
- * Every available buffer will try to trigger outgoingHandler.
9
- *
10
- * The internal buffer structure includes an incoming buffer array, and a outgoing
11
- * buffer array. The incoming buffer array includes the "empty" buffers can be filled
12
- * with new incoming data. The outgoing array includes the filled buffers to be
13
- * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize.
14
- *
15
- * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING
16
- *
17
- * NUM_OF_ALL_BUFFERS lesser than or equal to maxBuffers
18
- *
19
- * PERFORMANCE IMPROVEMENT TIPS:
20
- * 1. Input stream highWaterMark is better to set a same value with bufferSize
21
- * parameter, which will avoid Buffer.concat() operations.
22
- * 2. concurrency should set a smaller value than maxBuffers, which is helpful to
23
- * reduce the possibility when a outgoing handler waits for the stream data.
24
- * in this situation, outgoing handlers are blocked.
25
- * Outgoing queue shouldn't be empty.
26
- */
27
1
  export declare class BufferScheduler {
28
- /**
29
- * Size of buffers in incoming and outgoing queues. This class will try to align
30
- * data read from Readable stream into buffer chunks with bufferSize defined.
31
- */
32
- private readonly bufferSize;
33
- /**
34
- * How many buffers can be created or maintained.
35
- */
36
- private readonly maxBuffers;
37
- /**
38
- * A Node.js Readable stream.
39
- */
40
- private readonly readable;
41
- /**
42
- * OutgoingHandler is an async function triggered by BufferScheduler when there
43
- * are available buffers in outgoing array.
44
- */
45
- private readonly outgoingHandler;
46
- /**
47
- * An internal event emitter.
48
- */
49
- private readonly emitter;
50
- /**
51
- * Concurrency of executing outgoingHandlers. (0 lesser than concurrency lesser than or equal to maxBuffers)
52
- */
53
- private readonly concurrency;
54
- /**
55
- * An internal offset marker to track data offset in bytes of next outgoingHandler.
56
- */
57
- private offset;
58
- /**
59
- * An internal marker to track whether stream is end.
60
- */
61
- private isStreamEnd;
62
- /**
63
- * An internal marker to track whether stream or outgoingHandler returns error.
64
- */
65
- private isError;
66
- /**
67
- * How many handlers are executing.
68
- */
69
- private executingOutgoingHandlers;
70
- /**
71
- * Encoding of the input Readable stream which has string data type instead of Buffer.
72
- */
73
- private encoding?;
74
- /**
75
- * How many buffers have been allocated.
76
- */
77
- private numBuffers;
78
- /**
79
- * Because this class doesn't know how much data every time stream pops, which
80
- * is defined by highWaterMarker of the stream. So BufferScheduler will cache
81
- * data received from the stream, when data in unresolvedDataArray exceeds the
82
- * blockSize defined, it will try to concat a blockSize of buffer, fill into available
83
- * buffers from incoming and push to outgoing array.
84
- */
85
- private unresolvedDataArray;
86
- /**
87
- * How much data consisted in unresolvedDataArray.
88
- */
89
- private unresolvedLength;
90
- /**
91
- * The array includes all the available buffers can be used to fill data from stream.
92
- */
93
- private incoming;
94
- /**
95
- * The array (queue) includes all the buffers filled from stream data.
96
- */
97
- private outgoing;
98
- /**
99
- * Creates an instance of BufferScheduler.
100
- *
101
- * @param readable - A Node.js Readable stream
102
- * @param bufferSize - Buffer size of every maintained buffer
103
- * @param maxBuffers - How many buffers can be allocated
104
- * @param outgoingHandler - An async function scheduled to be
105
- * triggered when a buffer fully filled
106
- * with stream data
107
- * @param concurrency - Concurrency of executing outgoingHandlers (&gt;0)
108
- * @param encoding - [Optional] Encoding of Readable stream when it's a string stream
109
- */
110
- constructor(readable: NodeJS.ReadableStream, bufferSize: number, maxBuffers: number, outgoingHandler: OutgoingHandler, concurrency: number, encoding?: BufferEncoding);
111
- /**
112
- * Start the scheduler, will return error when stream of any of the outgoingHandlers
113
- * returns error.
114
- *
115
- */
116
- do(): Promise<void>;
117
- /**
118
- * Insert a new data into unresolved array.
119
- *
120
- * @param data -
121
- */
122
- private appendUnresolvedData;
123
- /**
124
- * Try to shift a buffer with size in blockSize. The buffer returned may be less
125
- * than blockSize when data in unresolvedDataArray is less than bufferSize.
126
- *
127
- */
128
- private shiftBufferFromUnresolvedDataArray;
129
- /**
130
- * Resolve data in unresolvedDataArray. For every buffer with size in blockSize
131
- * shifted, it will try to get (or allocate a buffer) from incoming, and fill it,
132
- * then push it into outgoing to be handled by outgoing handler.
133
- *
134
- * Return false when available buffers in incoming are not enough, else true.
135
- *
136
- * @returns Return false when buffers in incoming are not enough, else true.
137
- */
138
- private resolveData;
139
- /**
140
- * Try to trigger a outgoing handler for every buffer in outgoing. Stop when
141
- * concurrency reaches.
142
- */
143
- private triggerOutgoingHandlers;
144
- /**
145
- * Trigger a outgoing handler for a buffer shifted from outgoing.
146
- *
147
- * @param buffer -
148
- */
149
- private triggerOutgoingHandler;
150
- /**
151
- * Return buffer used by outgoing handler into incoming.
152
- *
153
- * @param buffer -
154
- */
155
- private reuseBuffer;
156
2
  }
157
- //# sourceMappingURL=BufferScheduler.d.ts.map
3
+ //# sourceMappingURL=BufferScheduler-react-native.d.mts.map
@@ -1,278 +1,8 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { EventEmitter } from "events";
4
- import { PooledBuffer } from "./PooledBuffer.js";
5
- /**
6
- * This class accepts a Node.js Readable stream as input, and keeps reading data
7
- * from the stream into the internal buffer structure, until it reaches maxBuffers.
8
- * Every available buffer will try to trigger outgoingHandler.
9
- *
10
- * The internal buffer structure includes an incoming buffer array, and a outgoing
11
- * buffer array. The incoming buffer array includes the "empty" buffers can be filled
12
- * with new incoming data. The outgoing array includes the filled buffers to be
13
- * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize.
14
- *
15
- * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING
16
- *
17
- * NUM_OF_ALL_BUFFERS lesser than or equal to maxBuffers
18
- *
19
- * PERFORMANCE IMPROVEMENT TIPS:
20
- * 1. Input stream highWaterMark is better to set a same value with bufferSize
21
- * parameter, which will avoid Buffer.concat() operations.
22
- * 2. concurrency should set a smaller value than maxBuffers, which is helpful to
23
- * reduce the possibility when a outgoing handler waits for the stream data.
24
- * in this situation, outgoing handlers are blocked.
25
- * Outgoing queue shouldn't be empty.
26
- */
3
+ // This file is used as a shim of "BufferScheduler" for bundlers
4
+ // when trying to bundle "BufferScheduler"
5
+ // "BufferScheduler" class is only available in Node.js runtime
27
6
  export class BufferScheduler {
28
- /**
29
- * Size of buffers in incoming and outgoing queues. This class will try to align
30
- * data read from Readable stream into buffer chunks with bufferSize defined.
31
- */
32
- bufferSize;
33
- /**
34
- * How many buffers can be created or maintained.
35
- */
36
- maxBuffers;
37
- /**
38
- * A Node.js Readable stream.
39
- */
40
- readable;
41
- /**
42
- * OutgoingHandler is an async function triggered by BufferScheduler when there
43
- * are available buffers in outgoing array.
44
- */
45
- outgoingHandler;
46
- /**
47
- * An internal event emitter.
48
- */
49
- emitter = new EventEmitter();
50
- /**
51
- * Concurrency of executing outgoingHandlers. (0 lesser than concurrency lesser than or equal to maxBuffers)
52
- */
53
- concurrency;
54
- /**
55
- * An internal offset marker to track data offset in bytes of next outgoingHandler.
56
- */
57
- offset = 0;
58
- /**
59
- * An internal marker to track whether stream is end.
60
- */
61
- isStreamEnd = false;
62
- /**
63
- * An internal marker to track whether stream or outgoingHandler returns error.
64
- */
65
- isError = false;
66
- /**
67
- * How many handlers are executing.
68
- */
69
- executingOutgoingHandlers = 0;
70
- /**
71
- * Encoding of the input Readable stream which has string data type instead of Buffer.
72
- */
73
- encoding;
74
- /**
75
- * How many buffers have been allocated.
76
- */
77
- numBuffers = 0;
78
- /**
79
- * Because this class doesn't know how much data every time stream pops, which
80
- * is defined by highWaterMarker of the stream. So BufferScheduler will cache
81
- * data received from the stream, when data in unresolvedDataArray exceeds the
82
- * blockSize defined, it will try to concat a blockSize of buffer, fill into available
83
- * buffers from incoming and push to outgoing array.
84
- */
85
- unresolvedDataArray = [];
86
- /**
87
- * How much data consisted in unresolvedDataArray.
88
- */
89
- unresolvedLength = 0;
90
- /**
91
- * The array includes all the available buffers can be used to fill data from stream.
92
- */
93
- incoming = [];
94
- /**
95
- * The array (queue) includes all the buffers filled from stream data.
96
- */
97
- outgoing = [];
98
- /**
99
- * Creates an instance of BufferScheduler.
100
- *
101
- * @param readable - A Node.js Readable stream
102
- * @param bufferSize - Buffer size of every maintained buffer
103
- * @param maxBuffers - How many buffers can be allocated
104
- * @param outgoingHandler - An async function scheduled to be
105
- * triggered when a buffer fully filled
106
- * with stream data
107
- * @param concurrency - Concurrency of executing outgoingHandlers (&gt;0)
108
- * @param encoding - [Optional] Encoding of Readable stream when it's a string stream
109
- */
110
- constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) {
111
- if (bufferSize <= 0) {
112
- throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`);
113
- }
114
- if (maxBuffers <= 0) {
115
- throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`);
116
- }
117
- if (concurrency <= 0) {
118
- throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`);
119
- }
120
- this.bufferSize = bufferSize;
121
- this.maxBuffers = maxBuffers;
122
- this.readable = readable;
123
- this.outgoingHandler = outgoingHandler;
124
- this.concurrency = concurrency;
125
- this.encoding = encoding;
126
- }
127
- /**
128
- * Start the scheduler, will return error when stream of any of the outgoingHandlers
129
- * returns error.
130
- *
131
- */
132
- async do() {
133
- return new Promise((resolve, reject) => {
134
- this.readable.on("data", (data) => {
135
- data = typeof data === "string" ? Buffer.from(data, this.encoding) : data;
136
- this.appendUnresolvedData(data);
137
- if (!this.resolveData()) {
138
- this.readable.pause();
139
- }
140
- });
141
- this.readable.on("error", (err) => {
142
- this.emitter.emit("error", err);
143
- });
144
- this.readable.on("end", () => {
145
- this.isStreamEnd = true;
146
- this.emitter.emit("checkEnd");
147
- });
148
- this.emitter.on("error", (err) => {
149
- this.isError = true;
150
- this.readable.pause();
151
- reject(err);
152
- });
153
- this.emitter.on("checkEnd", () => {
154
- if (this.outgoing.length > 0) {
155
- this.triggerOutgoingHandlers();
156
- return;
157
- }
158
- if (this.isStreamEnd && this.executingOutgoingHandlers === 0) {
159
- if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) {
160
- const buffer = this.shiftBufferFromUnresolvedDataArray();
161
- this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset)
162
- .then(resolve)
163
- .catch(reject);
164
- }
165
- else if (this.unresolvedLength >= this.bufferSize) {
166
- return;
167
- }
168
- else {
169
- resolve();
170
- }
171
- }
172
- });
173
- });
174
- }
175
- /**
176
- * Insert a new data into unresolved array.
177
- *
178
- * @param data -
179
- */
180
- appendUnresolvedData(data) {
181
- this.unresolvedDataArray.push(data);
182
- this.unresolvedLength += data.length;
183
- }
184
- /**
185
- * Try to shift a buffer with size in blockSize. The buffer returned may be less
186
- * than blockSize when data in unresolvedDataArray is less than bufferSize.
187
- *
188
- */
189
- shiftBufferFromUnresolvedDataArray(buffer) {
190
- if (!buffer) {
191
- buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength);
192
- }
193
- else {
194
- buffer.fill(this.unresolvedDataArray, this.unresolvedLength);
195
- }
196
- this.unresolvedLength -= buffer.size;
197
- return buffer;
198
- }
199
- /**
200
- * Resolve data in unresolvedDataArray. For every buffer with size in blockSize
201
- * shifted, it will try to get (or allocate a buffer) from incoming, and fill it,
202
- * then push it into outgoing to be handled by outgoing handler.
203
- *
204
- * Return false when available buffers in incoming are not enough, else true.
205
- *
206
- * @returns Return false when buffers in incoming are not enough, else true.
207
- */
208
- resolveData() {
209
- while (this.unresolvedLength >= this.bufferSize) {
210
- let buffer;
211
- if (this.incoming.length > 0) {
212
- buffer = this.incoming.shift();
213
- this.shiftBufferFromUnresolvedDataArray(buffer);
214
- }
215
- else {
216
- if (this.numBuffers < this.maxBuffers) {
217
- buffer = this.shiftBufferFromUnresolvedDataArray();
218
- this.numBuffers++;
219
- }
220
- else {
221
- // No available buffer, wait for buffer returned
222
- return false;
223
- }
224
- }
225
- this.outgoing.push(buffer);
226
- this.triggerOutgoingHandlers();
227
- }
228
- return true;
229
- }
230
- /**
231
- * Try to trigger a outgoing handler for every buffer in outgoing. Stop when
232
- * concurrency reaches.
233
- */
234
- async triggerOutgoingHandlers() {
235
- let buffer;
236
- do {
237
- if (this.executingOutgoingHandlers >= this.concurrency) {
238
- return;
239
- }
240
- buffer = this.outgoing.shift();
241
- if (buffer) {
242
- this.triggerOutgoingHandler(buffer);
243
- }
244
- } while (buffer);
245
- }
246
- /**
247
- * Trigger a outgoing handler for a buffer shifted from outgoing.
248
- *
249
- * @param buffer -
250
- */
251
- async triggerOutgoingHandler(buffer) {
252
- const bufferLength = buffer.size;
253
- this.executingOutgoingHandlers++;
254
- this.offset += bufferLength;
255
- try {
256
- await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength);
257
- }
258
- catch (err) {
259
- this.emitter.emit("error", err);
260
- return;
261
- }
262
- this.executingOutgoingHandlers--;
263
- this.reuseBuffer(buffer);
264
- this.emitter.emit("checkEnd");
265
- }
266
- /**
267
- * Return buffer used by outgoing handler into incoming.
268
- *
269
- * @param buffer -
270
- */
271
- reuseBuffer(buffer) {
272
- this.incoming.push(buffer);
273
- if (!this.isError && this.resolveData() && !this.isStreamEnd) {
274
- this.readable.resume();
275
- }
276
- }
277
7
  }
278
- //# sourceMappingURL=BufferScheduler.js.map
8
+ //# sourceMappingURL=BufferScheduler-react-native.mjs.map
@@ -1,7 +1,7 @@
1
1
  import type { RequestPolicy, RequestPolicyOptionsLike as RequestPolicyOptions, RequestPolicyFactory } from "@azure/core-http-compat";
2
- import { StorageRetryPolicy } from "./policies/StorageRetryPolicy.js";
2
+ import { StorageRetryPolicy, NewRetryPolicyFactory } from "./policies/StorageRetryPolicy.js";
3
3
  import { StorageRetryPolicyType } from "./policies/StorageRetryPolicyType.js";
4
- export { StorageRetryPolicyType, StorageRetryPolicy };
4
+ export { StorageRetryPolicyType, StorageRetryPolicy, NewRetryPolicyFactory };
5
5
  /**
6
6
  * Storage Blob retry options interface.
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"StorageRetryPolicyFactory.d.ts","sourceRoot":"","sources":["../../src/StorageRetryPolicyFactory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,IAAI,oBAAoB,EAChD,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,sBAAsB,CAAC;IAElD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAEpC;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;GAEG;AACH,qBAAa,yBAA0B,YAAW,oBAAoB;IACpE,OAAO,CAAC,YAAY,CAAC,CAAsB;IAE3C;;;OAGG;gBACS,YAAY,CAAC,EAAE,mBAAmB;IAI9C;;;;;OAKG;IACI,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,oBAAoB,GAAG,kBAAkB;CAG5F"}
1
+ {"version":3,"file":"StorageRetryPolicyFactory.d.ts","sourceRoot":"","sources":["../../src/StorageRetryPolicyFactory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,IAAI,oBAAoB,EAChD,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,sBAAsB,CAAC;IAElD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAEpC;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;GAEG;AACH,qBAAa,yBAA0B,YAAW,oBAAoB;IACpE,OAAO,CAAC,YAAY,CAAC,CAAsB;IAE3C;;;OAGG;gBACS,YAAY,CAAC,EAAE,mBAAmB;IAI9C;;;;;OAKG;IACI,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,oBAAoB,GAAG,kBAAkB;CAG5F"}
@@ -1,8 +1,8 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { StorageRetryPolicy } from "./policies/StorageRetryPolicy.js";
3
+ import { StorageRetryPolicy, NewRetryPolicyFactory } from "./policies/StorageRetryPolicy.js";
4
4
  import { StorageRetryPolicyType } from "./policies/StorageRetryPolicyType.js";
5
- export { StorageRetryPolicyType, StorageRetryPolicy };
5
+ export { StorageRetryPolicyType, StorageRetryPolicy, NewRetryPolicyFactory };
6
6
  /**
7
7
  * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"StorageRetryPolicyFactory.js","sourceRoot":"","sources":["../../src/StorageRetryPolicyFactory.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,CAAC;AAmDtD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAC5B,YAAY,CAAuB;IAE3C;;;OAGG;IACH,YAAY,YAAkC;QAC5C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAyB,EAAE,OAA6B;QACpE,OAAO,IAAI,kBAAkB,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACxE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n RequestPolicyFactory,\n} from \"@azure/core-http-compat\";\nimport { StorageRetryPolicy } from \"./policies/StorageRetryPolicy.js\";\nimport { StorageRetryPolicyType } from \"./policies/StorageRetryPolicyType.js\";\n\nexport { StorageRetryPolicyType, StorageRetryPolicy };\n\n/**\n * Storage Blob retry options interface.\n */\nexport interface StorageRetryOptions {\n /**\n * Optional. StorageRetryPolicyType, default is exponential retry policy.\n */\n readonly retryPolicyType?: StorageRetryPolicyType;\n\n /**\n * Optional. Max try number of attempts, default is 4.\n * A value of 1 means 1 try and no retries.\n * A value smaller than 1 means default retry number of attempts.\n */\n readonly maxTries?: number;\n\n /**\n * Optional. Indicates the maximum time in ms allowed for any single try of an HTTP request.\n * A value of zero or undefined means no default timeout on SDK client, Azure\n * Storage server's default timeout policy will be used.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations\n */\n readonly tryTimeoutInMs?: number;\n\n /**\n * Optional. Specifies the amount of delay to use before retrying an operation (default is 4s or 4 * 1000ms).\n * The delay increases (exponentially or linearly) with each retry up to a maximum specified by\n * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs.\n */\n readonly retryDelayInMs?: number;\n\n /**\n * Optional. Specifies the maximum delay allowed before retrying an operation (default is 120s or 120 * 1000ms).\n * If you specify 0, then you must also specify 0 for retryDelayInMs.\n */\n readonly maxRetryDelayInMs?: number;\n\n /**\n * If a secondaryHost is specified, retries will be tried against this host. If secondaryHost is undefined\n * (the default) then operations are not retried against another host.\n *\n * NOTE: Before setting this field, make sure you understand the issues around\n * reading stale and potentially-inconsistent data at\n * {@link https://learn.microsoft.com/azure/storage/common/storage-designing-ha-apps-with-ragrs}\n */\n readonly secondaryHost?: string;\n}\n\n/**\n * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.\n */\nexport class StorageRetryPolicyFactory implements RequestPolicyFactory {\n private retryOptions?: StorageRetryOptions;\n\n /**\n * Creates an instance of StorageRetryPolicyFactory.\n * @param retryOptions -\n */\n constructor(retryOptions?: StorageRetryOptions) {\n this.retryOptions = retryOptions;\n }\n\n /**\n * Creates a StorageRetryPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageRetryPolicy {\n return new StorageRetryPolicy(nextPolicy, options, this.retryOptions);\n }\n}\n"]}
1
+ {"version":3,"file":"StorageRetryPolicyFactory.js","sourceRoot":"","sources":["../../src/StorageRetryPolicyFactory.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AAmD7E;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAC5B,YAAY,CAAuB;IAE3C;;;OAGG;IACH,YAAY,YAAkC;QAC5C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAyB,EAAE,OAA6B;QACpE,OAAO,IAAI,kBAAkB,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACxE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n RequestPolicyFactory,\n} from \"@azure/core-http-compat\";\nimport { StorageRetryPolicy, NewRetryPolicyFactory } from \"./policies/StorageRetryPolicy.js\";\nimport { StorageRetryPolicyType } from \"./policies/StorageRetryPolicyType.js\";\n\nexport { StorageRetryPolicyType, StorageRetryPolicy, NewRetryPolicyFactory };\n\n/**\n * Storage Blob retry options interface.\n */\nexport interface StorageRetryOptions {\n /**\n * Optional. StorageRetryPolicyType, default is exponential retry policy.\n */\n readonly retryPolicyType?: StorageRetryPolicyType;\n\n /**\n * Optional. Max try number of attempts, default is 4.\n * A value of 1 means 1 try and no retries.\n * A value smaller than 1 means default retry number of attempts.\n */\n readonly maxTries?: number;\n\n /**\n * Optional. Indicates the maximum time in ms allowed for any single try of an HTTP request.\n * A value of zero or undefined means no default timeout on SDK client, Azure\n * Storage server's default timeout policy will be used.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations\n */\n readonly tryTimeoutInMs?: number;\n\n /**\n * Optional. Specifies the amount of delay to use before retrying an operation (default is 4s or 4 * 1000ms).\n * The delay increases (exponentially or linearly) with each retry up to a maximum specified by\n * maxRetryDelayInMs. If you specify 0, then you must also specify 0 for maxRetryDelayInMs.\n */\n readonly retryDelayInMs?: number;\n\n /**\n * Optional. Specifies the maximum delay allowed before retrying an operation (default is 120s or 120 * 1000ms).\n * If you specify 0, then you must also specify 0 for retryDelayInMs.\n */\n readonly maxRetryDelayInMs?: number;\n\n /**\n * If a secondaryHost is specified, retries will be tried against this host. If secondaryHost is undefined\n * (the default) then operations are not retried against another host.\n *\n * NOTE: Before setting this field, make sure you understand the issues around\n * reading stale and potentially-inconsistent data at\n * {@link https://learn.microsoft.com/azure/storage/common/storage-designing-ha-apps-with-ragrs}\n */\n readonly secondaryHost?: string;\n}\n\n/**\n * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.\n */\nexport class StorageRetryPolicyFactory implements RequestPolicyFactory {\n private retryOptions?: StorageRetryOptions;\n\n /**\n * Creates an instance of StorageRetryPolicyFactory.\n * @param retryOptions -\n */\n constructor(retryOptions?: StorageRetryOptions) {\n this.retryOptions = retryOptions;\n }\n\n /**\n * Creates a StorageRetryPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n public create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageRetryPolicy {\n return new StorageRetryPolicy(nextPolicy, options, this.retryOptions);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageSharedKeyCredential-react-native.d.mts","sourceRoot":"","sources":["../../../src/credentials/StorageSharedKeyCredential-react-native.mts"],"names":[],"mappings":"AAGA,qBAAa,0BAA0B;CAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageSharedKeyCredential-react-native.mjs","sourceRoot":"","sources":["../../../src/credentials/StorageSharedKeyCredential-react-native.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,OAAO,0BAA0B;CAAG","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport class StorageSharedKeyCredential {}\n"]}
@@ -1,38 +1,3 @@
1
- import type { RequestPolicy, RequestPolicyOptionsLike as RequestPolicyOptions } from "@azure/core-http-compat";
2
- import { StorageSharedKeyCredentialPolicy } from "../policies/StorageSharedKeyCredentialPolicy.js";
3
- import { Credential } from "./Credential.js";
4
- /**
5
- * ONLY AVAILABLE IN NODE.JS RUNTIME.
6
- *
7
- * StorageSharedKeyCredential for account key authorization of Azure Storage service.
8
- */
9
- export declare class StorageSharedKeyCredential extends Credential {
10
- /**
11
- * Azure Storage account name; readonly.
12
- */
13
- readonly accountName: string;
14
- /**
15
- * Azure Storage account key; readonly.
16
- */
17
- private readonly accountKey;
18
- /**
19
- * Creates an instance of StorageSharedKeyCredential.
20
- * @param accountName -
21
- * @param accountKey -
22
- */
23
- constructor(accountName: string, accountKey: string);
24
- /**
25
- * Creates a StorageSharedKeyCredentialPolicy object.
26
- *
27
- * @param nextPolicy -
28
- * @param options -
29
- */
30
- create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageSharedKeyCredentialPolicy;
31
- /**
32
- * Generates a hash signature for an HTTP request or for a SAS.
33
- *
34
- * @param stringToSign -
35
- */
36
- computeHMACSHA256(stringToSign: string): string;
1
+ export declare class StorageSharedKeyCredential {
37
2
  }
38
- //# sourceMappingURL=StorageSharedKeyCredential.d.ts.map
3
+ //# sourceMappingURL=StorageSharedKeyCredential-react-native.d.mts.map
@@ -1,48 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { createHmac } from "node:crypto";
4
- import { StorageSharedKeyCredentialPolicy } from "../policies/StorageSharedKeyCredentialPolicy.js";
5
- import { Credential } from "./Credential.js";
6
- /**
7
- * ONLY AVAILABLE IN NODE.JS RUNTIME.
8
- *
9
- * StorageSharedKeyCredential for account key authorization of Azure Storage service.
10
- */
11
- export class StorageSharedKeyCredential extends Credential {
12
- /**
13
- * Azure Storage account name; readonly.
14
- */
15
- accountName;
16
- /**
17
- * Azure Storage account key; readonly.
18
- */
19
- accountKey;
20
- /**
21
- * Creates an instance of StorageSharedKeyCredential.
22
- * @param accountName -
23
- * @param accountKey -
24
- */
25
- constructor(accountName, accountKey) {
26
- super();
27
- this.accountName = accountName;
28
- this.accountKey = Buffer.from(accountKey, "base64");
29
- }
30
- /**
31
- * Creates a StorageSharedKeyCredentialPolicy object.
32
- *
33
- * @param nextPolicy -
34
- * @param options -
35
- */
36
- create(nextPolicy, options) {
37
- return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this);
38
- }
39
- /**
40
- * Generates a hash signature for an HTTP request or for a SAS.
41
- *
42
- * @param stringToSign -
43
- */
44
- computeHMACSHA256(stringToSign) {
45
- return createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64");
46
- }
3
+ export class StorageSharedKeyCredential {
47
4
  }
48
- //# sourceMappingURL=StorageSharedKeyCredential.js.map
5
+ //# sourceMappingURL=StorageSharedKeyCredential-react-native.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserDelegationKeyCredential-react-native.d.mts","sourceRoot":"","sources":["../../../src/credentials/UserDelegationKeyCredential-react-native.mts"],"names":[],"mappings":"AAGA,qBAAa,2BAA2B;CAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserDelegationKeyCredential-react-native.mjs","sourceRoot":"","sources":["../../../src/credentials/UserDelegationKeyCredential-react-native.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,OAAO,2BAA2B;CAAG","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport class UserDelegationKeyCredential {}\n"]}
@@ -1,66 +1,3 @@
1
- /**
2
- * A user delegation key.
3
- */
4
- export interface UserDelegationKey {
5
- /**
6
- * The Azure Active Directory object ID in GUID format.
7
- */
8
- signedObjectId: string;
9
- /**
10
- * The Azure Active Directory tenant ID in GUID format.
11
- */
12
- signedTenantId: string;
13
- /**
14
- * The date-time the key is active.
15
- */
16
- signedStartsOn: Date;
17
- /**
18
- * The date-time the key expires.
19
- */
20
- signedExpiresOn: Date;
21
- /**
22
- * Abbreviation of the Azure Storage service that accepts the key.
23
- */
24
- signedService: string;
25
- /**
26
- * The service version that created the key.
27
- */
28
- signedVersion: string;
29
- /**
30
- * The key as a base64 string.
31
- */
32
- value: string;
33
- }
34
- /**
35
- * ONLY AVAILABLE IN NODE.JS RUNTIME.
36
- *
37
- * UserDelegationKeyCredential is only used for generation of user delegation SAS.
38
- * @see https://learn.microsoft.com/rest/api/storageservices/create-user-delegation-sas
39
- */
40
1
  export declare class UserDelegationKeyCredential {
41
- /**
42
- * Azure Storage account name; readonly.
43
- */
44
- readonly accountName: string;
45
- /**
46
- * Azure Storage user delegation key; readonly.
47
- */
48
- readonly userDelegationKey: UserDelegationKey;
49
- /**
50
- * Key value in Buffer type.
51
- */
52
- private readonly key;
53
- /**
54
- * Creates an instance of UserDelegationKeyCredential.
55
- * @param accountName -
56
- * @param userDelegationKey -
57
- */
58
- constructor(accountName: string, userDelegationKey: UserDelegationKey);
59
- /**
60
- * Generates a hash signature for an HTTP request or for a SAS.
61
- *
62
- * @param stringToSign -
63
- */
64
- computeHMACSHA256(stringToSign: string): string;
65
2
  }
66
- //# sourceMappingURL=UserDelegationKeyCredential.d.ts.map
3
+ //# sourceMappingURL=UserDelegationKeyCredential-react-native.d.mts.map