azure-mock 2.13.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +146 -188
  2. package/dist/index.js +40 -26
  3. package/package.json +5 -5
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { AnonymousCredential, AppendBlobClient, BlobAbortCopyFromURLResponse, BlobBatchClient, BlobBatchDeleteBlobsResponse, BlobBeginCopyFromURLResponse, BlobClient, BlobCopyFromURLResponse, BlobCreateSnapshotResponse, BlobDeleteIfExistsResponse, BlobDeleteImmutabilityPolicyResponse, BlobDeleteOptions, BlobDeleteResponse, BlobDownloadResponseModel, BlobDownloadResponseParsed, BlobGetAccountInfoResponse, BlobGetPropertiesResponse, BlobGetTagsResponse, BlobItem, BlobLeaseClient, BlobPrefix, BlobSetHTTPHeadersResponse, BlobSetImmutabilityPolicyResponse, BlobSetLegalHoldResponse, BlobSetMetadataResponse, BlobSetTagsResponse, BlobSetTierResponse, BlobUndeleteResponse, BlobUploadCommonResponse, BlockBlobClient, BlockBlobCommitBlockListResponse, BlockBlobGetBlockListResponse, BlockBlobPutBlobFromUrlResponse, BlockBlobStageBlockFromURLResponse, BlockBlobStageBlockResponse, BlockBlobUploadResponse, ContainerClient, ContainerCreateIfNotExistsResponse, ContainerCreateResponse, ContainerDeleteIfExistsResponse, ContainerDeleteResponse, ContainerFindBlobsByTagsSegmentResponse, ContainerGetAccessPolicyResponse, ContainerGetAccountInfoResponse, ContainerGetPropertiesResponse, ContainerListBlobFlatSegmentResponse, ContainerListBlobHierarchySegmentResponse, ContainerListBlobsOptions, ContainerSetAccessPolicyResponse, ContainerSetMetadataResponse, FilterBlobItem, HttpRequestBody, PageBlobClient, PollOperationState, PollerLikeWithCancellation, StorageSharedKeyCredential } from "@azure/storage-blob";
2
- import { MapValue } from "type-fest/source/entry";
3
2
  import { CreateTableEntityResponse, GetAccessPolicyResponse, GetTableEntityResponse, ListTableEntitiesOptions, TableClient, TableDeleteEntityHeaders, TableEntity, TableEntityResult, TableEntityResultPage, TableMergeEntityHeaders, TableSetAccessPolicyHeaders, TableTransactionResponse, UpdateMode } from "@azure/data-tables";
4
3
 
5
4
  //#region src/models/BlobHierarchyItem.d.ts
@@ -9,6 +8,25 @@ type BlobHierarchyItem = (BlobItem & {
9
8
  kind: "prefix";
10
9
  });
11
10
  //#endregion
11
+ //#region ../shared/dist/index.d.ts
12
+ //#region src/models/azure/BinaryOperator.d.ts
13
+ declare enum BinaryOperator {
14
+ eq = "eq",
15
+ ge = "ge",
16
+ gt = "gt",
17
+ le = "le",
18
+ lt = "lt",
19
+ ne = "ne",
20
+ }
21
+ //#endregion
22
+ //#region src/models/azure/Literal.d.ts
23
+
24
+ //#endregion
25
+ //#region src/util/types/MapValue.d.ts
26
+ type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
27
+ //#endregion
28
+ //#region src/util/types/TupleSplitHead.d.ts
29
+ //#endregion
12
30
  //#region src/store/MockContainerDatabase.d.ts
13
31
  declare const MockContainerDatabase: Map<string, Map<string, Buffer>>;
14
32
  //#endregion
@@ -26,27 +44,81 @@ declare class MockBlobBatchClient implements BlobBatchClient {
26
44
  getContainer(containerName: string): MapValue<typeof MockContainerDatabase>;
27
45
  }
28
46
  //#endregion
29
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/observable-like.d.ts
30
- declare global {
31
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
32
- interface SymbolConstructor {
33
- readonly observable: symbol;
34
- }
47
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/is-any.d.ts
48
+ /**
49
+ Returns a boolean for whether the given type is `any`.
50
+
51
+ @link https://stackoverflow.com/a/49928360/1490091
52
+
53
+ Useful in type utilities, such as disallowing `any`s to be passed to a function.
54
+
55
+ @example
56
+ ```
57
+ import type {IsAny} from 'type-fest';
58
+
59
+ const typedObject = {a: 1, b: 2} as const;
60
+ const anyObject: any = {a: 1, b: 2};
61
+
62
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
63
+ return obj[key];
35
64
  }
36
65
 
37
- /**
38
- @remarks
39
- The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
40
- As well, some guidance on making an `Observable` to not include `closed` property.
41
- @see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
42
- @see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
43
- @see https://github.com/benlesh/symbol-observable#making-an-object-observable
44
-
45
- @category Observable
66
+ const typedA = get(typedObject, 'a');
67
+ //=> 1
68
+
69
+ const anyA = get(anyObject, 'a');
70
+ //=> any
71
+ ```
72
+
73
+ @category Type Guard
74
+ @category Utilities
46
75
  */
76
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
77
+ //#endregion
78
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/is-optional-key-of.d.ts
79
+ /**
80
+ Returns a boolean for whether the given key is an optional key of type.
81
+
82
+ This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
47
83
 
84
+ @example
85
+ ```
86
+ import type {IsOptionalKeyOf} from 'type-fest';
87
+
88
+ interface User {
89
+ name: string;
90
+ surname: string;
91
+
92
+ luckyNumber?: number;
93
+ }
94
+
95
+ interface Admin {
96
+ name: string;
97
+ surname?: string;
98
+ }
99
+
100
+ type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
101
+ //=> true
102
+
103
+ type T2 = IsOptionalKeyOf<User, 'name'>;
104
+ //=> false
105
+
106
+ type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
107
+ //=> boolean
108
+
109
+ type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
110
+ //=> false
111
+
112
+ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
113
+ //=> boolean
114
+ ```
115
+
116
+ @category Type Guard
117
+ @category Utilities
118
+ */
119
+ type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
48
120
  //#endregion
49
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/optional-keys-of.d.ts
121
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/optional-keys-of.d.ts
50
122
  /**
51
123
  Extract all optional keys from the given type.
52
124
 
@@ -80,11 +152,11 @@ const update2: UpdateOperation<User> = {
80
152
 
81
153
  @category Utilities
82
154
  */
83
- type OptionalKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
84
- ? (keyof { [Key in keyof BaseType as BaseType extends Record<Key, BaseType[Key]> ? never : Key]: never }) & (keyof BaseType) // Intersect with `keyof BaseType` to ensure result of `OptionalKeysOf<BaseType>` is always assignable to `keyof BaseType`
85
- : never; // Should never happen
155
+ type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
156
+ ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
157
+ : never;
86
158
  //#endregion
87
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/required-keys-of.d.ts
159
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/required-keys-of.d.ts
88
160
  /**
89
161
  Extract all required keys from the given type.
90
162
 
@@ -109,11 +181,10 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
109
181
 
110
182
  @category Utilities
111
183
  */
112
- type RequiredKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
113
- ? Exclude<keyof BaseType, OptionalKeysOf<BaseType>> : never; // Should never happen
114
-
184
+ type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
185
+ ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
115
186
  //#endregion
116
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/is-never.d.ts
187
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/is-never.d.ts
117
188
  /**
118
189
  Returns a boolean for whether the given type is `never`.
119
190
 
@@ -157,64 +228,67 @@ endIfEqual('abc', '123');
157
228
  */
158
229
  type IsNever<T> = [T] extends [never] ? true : false;
159
230
  //#endregion
160
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/if-never.d.ts
231
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/if.d.ts
161
232
  /**
162
- An if-else-like type that resolves depending on whether the given type is `never`.
233
+ An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
163
234
 
164
- @see {@link IsNever}
235
+ Use-cases:
236
+ - You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.
237
+
238
+ Note:
239
+ - Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.
240
+ - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
165
241
 
166
242
  @example
167
243
  ```
168
- import type {IfNever} from 'type-fest';
169
-
170
- type ShouldBeTrue = IfNever<never>;
171
- //=> true
244
+ import {If} from 'type-fest';
172
245
 
173
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
174
- //=> 'bar'
175
- ```
246
+ type A = If<true, 'yes', 'no'>;
247
+ //=> 'yes'
176
248
 
177
- @category Type Guard
178
- @category Utilities
179
- */
180
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (IsNever<T> extends true ? TypeIfNever : TypeIfNotNever);
181
- //#endregion
182
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/is-any.d.ts
183
- // Can eventually be replaced with the built-in once this library supports
184
- // TS5.4+ only. Tracked in https://github.com/sindresorhus/type-fest/issues/848
185
- type NoInfer<T> = T extends infer U ? U : never;
249
+ type B = If<false, 'yes', 'no'>;
250
+ //=> 'no'
186
251
 
187
- /**
188
- Returns a boolean for whether the given type is `any`.
252
+ type C = If<boolean, 'yes', 'no'>;
253
+ //=> 'yes' | 'no'
189
254
 
190
- @link https://stackoverflow.com/a/49928360/1490091
255
+ type D = If<any, 'yes', 'no'>;
256
+ //=> 'yes' | 'no'
191
257
 
192
- Useful in type utilities, such as disallowing `any`s to be passed to a function.
258
+ type E = If<never, 'yes', 'no'>;
259
+ //=> 'no'
260
+ ```
193
261
 
194
262
  @example
195
263
  ```
196
- import type {IsAny} from 'type-fest';
264
+ import {If, IsAny, IsNever} from 'type-fest';
197
265
 
198
- const typedObject = {a: 1, b: 2} as const;
199
- const anyObject: any = {a: 1, b: 2};
266
+ type A = If<IsAny<unknown>, 'is any', 'not any'>;
267
+ //=> 'not any'
200
268
 
201
- function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
202
- return obj[key];
203
- }
269
+ type B = If<IsNever<never>, 'is never', 'not never'>;
270
+ //=> 'is never'
271
+ ```
204
272
 
205
- const typedA = get(typedObject, 'a');
206
- //=> 1
273
+ @example
274
+ ```
275
+ import {If, IsEqual} from 'type-fest';
207
276
 
208
- const anyA = get(anyObject, 'a');
209
- //=> any
277
+ type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
278
+
279
+ type A = IfEqual<string, string, 'equal', 'not equal'>;
280
+ //=> 'equal'
281
+
282
+ type B = IfEqual<string, number, 'equal', 'not equal'>;
283
+ //=> 'not equal'
210
284
  ```
211
285
 
212
286
  @category Type Guard
213
287
  @category Utilities
214
288
  */
215
- type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
289
+ type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
216
290
  //#endregion
217
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/is-equal.d.ts
291
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/is-equal.d.ts
218
292
  /**
219
293
  Returns a boolean for whether the two given types are equal.
220
294
 
@@ -243,7 +317,7 @@ type Includes<Value extends readonly any[], Item> =
243
317
  */
244
318
  type IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
245
319
  //#endregion
246
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/simplify.d.ts
320
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/simplify.d.ts
247
321
  /**
248
322
  Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
249
323
 
@@ -303,7 +377,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
303
377
  */
304
378
  type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
305
379
  //#endregion
306
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/omit-index-signature.d.ts
380
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/omit-index-signature.d.ts
307
381
  /**
308
382
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
309
383
 
@@ -396,7 +470,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
396
470
  */
397
471
  type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
398
472
  //#endregion
399
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/pick-index-signature.d.ts
473
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/pick-index-signature.d.ts
400
474
  /**
401
475
  Pick only index signatures from the given object type, leaving out all explicitly defined properties.
402
476
 
@@ -444,7 +518,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
444
518
  */
445
519
  type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
446
520
  //#endregion
447
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/merge.d.ts
521
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/merge.d.ts
448
522
  // Merges two objects without worrying about index signatures.
449
523
  type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
450
524
 
@@ -484,29 +558,7 @@ export type FooBar = Merge<Foo, Bar>;
484
558
  */
485
559
  type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
486
560
  //#endregion
487
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/if-any.d.ts
488
- /**
489
- An if-else-like type that resolves depending on whether the given type is `any`.
490
-
491
- @see {@link IsAny}
492
-
493
- @example
494
- ```
495
- import type {IfAny} from 'type-fest';
496
-
497
- type ShouldBeTrue = IfAny<any>;
498
- //=> true
499
-
500
- type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>;
501
- //=> 'bar'
502
- ```
503
-
504
- @category Type Guard
505
- @category Utilities
506
- */
507
- type IfAny<T, TypeIfAny = true, TypeIfNotAny = false> = (IsAny<T> extends true ? TypeIfAny : TypeIfNotAny);
508
- //#endregion
509
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/internal/object.d.ts
561
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/internal/object.d.ts
510
562
  /**
511
563
  Merges user specified options with default options.
512
564
 
@@ -559,10 +611,9 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
559
611
  // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
560
612
  ```
561
613
  */
562
- type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = IfAny<SpecifiedOptions, Defaults, IfNever<SpecifiedOptions, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? Extract<SpecifiedOptions[Key], undefined> extends never ? Key : never : Key]: SpecifiedOptions[Key] }> & Required<Options>> // `& Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
563
- >>;
614
+ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
564
615
  //#endregion
565
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/except.d.ts
616
+ //#region ../../node_modules/.pnpm/type-fest@5.0.0/node_modules/type-fest/source/except.d.ts
566
617
  /**
567
618
  Filter out keys from an object.
568
619
 
@@ -899,19 +950,15 @@ declare global {
899
950
  interface Event {}
900
951
  }
901
952
  //#endregion
902
- //#region ../../node_modules/.pnpm/@azure+core-util@1.13.0/node_modules/@azure/core-util/dist/esm/index.d.ts
953
+ //#region ../../node_modules/.pnpm/@azure+core-util@1.13.1/node_modules/@azure/core-util/dist/esm/index.d.ts
903
954
  /**
904
955
  * Supported HTTP methods to use when making requests.
905
956
  *
906
957
  * @public
907
958
  */
908
959
  type HttpMethods = "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "TRACE";
909
- /**
910
- * A generic shape for a plain JS object.
911
- */
912
-
913
960
  //#endregion
914
- //#region ../../node_modules/.pnpm/@azure+core-tracing@1.3.0/node_modules/@azure/core-tracing/dist/esm/interfaces.d.ts
961
+ //#region ../../node_modules/.pnpm/@azure+core-tracing@1.3.1/node_modules/@azure/core-tracing/dist/esm/interfaces.d.ts
915
962
  /** An immutable context bag of tracing values for the current operation. */
916
963
  interface TracingContext {
917
964
  /**
@@ -942,22 +989,14 @@ interface OperationTracingOptions {
942
989
  /** The context to use for created Tracing Spans. */
943
990
  tracingContext?: TracingContext;
944
991
  }
945
- /**
946
- * A utility type for when we know a TracingContext has been set
947
- * as part of an operation's options.
948
- */
949
992
  //#endregion
950
- //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.22.0/node_modules/@azure/core-rest-pipeline/dist/esm/interfaces.d.ts
993
+ //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.22.1/node_modules/@azure/core-rest-pipeline/dist/esm/interfaces.d.ts
951
994
  /**
952
995
  * A HttpHeaders collection represented as a simple JSON object.
953
996
  */
954
997
  type RawHttpHeaders$1 = {
955
998
  [headerName: string]: string;
956
999
  };
957
- /**
958
- * A HttpHeaders collection for input, represented as a simple JSON object.
959
- */
960
-
961
1000
  /**
962
1001
  * Represents a set of HTTP headers on a request/response.
963
1002
  * Header names are treated as case insensitive.
@@ -1156,10 +1195,6 @@ interface PipelineRequest {
1156
1195
  */
1157
1196
  requestOverrides?: Record<string, unknown>;
1158
1197
  }
1159
- /**
1160
- * Metadata about a response received by the pipeline.
1161
- */
1162
-
1163
1198
  /**
1164
1199
  * Fired in response to upload or download progress.
1165
1200
  */
@@ -1202,10 +1237,6 @@ type FormDataValue = string | Blob | File;
1202
1237
  type FormDataMap = {
1203
1238
  [key: string]: FormDataValue | FormDataValue[];
1204
1239
  };
1205
- /**
1206
- * Options that control how to retry failed requests.
1207
- */
1208
-
1209
1240
  /**
1210
1241
  * Represents a certificate for TLS authentication.
1211
1242
  */
@@ -1284,7 +1315,7 @@ interface PxfObject {
1284
1315
  passphrase?: string | undefined;
1285
1316
  }
1286
1317
  //#endregion
1287
- //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.22.0/node_modules/@azure/core-rest-pipeline/dist/esm/index.d.ts
1318
+ //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.22.1/node_modules/@azure/core-rest-pipeline/dist/esm/index.d.ts
1288
1319
  declare global {
1289
1320
  interface FormData {}
1290
1321
  interface Blob {}
@@ -1293,7 +1324,7 @@ declare global {
1293
1324
  interface TransformStream<I = any, O = any> {}
1294
1325
  }
1295
1326
  //#endregion
1296
- //#region ../../node_modules/.pnpm/@azure+core-http-compat@2.3.0/node_modules/@azure/core-http-compat/dist/esm/util.d.ts
1327
+ //#region ../../node_modules/.pnpm/@azure+core-http-compat@2.3.1/node_modules/@azure/core-http-compat/dist/esm/util.d.ts
1297
1328
  /**
1298
1329
  * An individual header within a HttpHeaders collection.
1299
1330
  */
@@ -1368,10 +1399,6 @@ interface HttpHeadersLike {
1368
1399
  preserveCase?: boolean;
1369
1400
  }): RawHttpHeaders;
1370
1401
  }
1371
- /**
1372
- * A collection of HTTP header key/value pairs.
1373
- */
1374
-
1375
1402
  /**
1376
1403
  * An interface compatible with NodeJS's `http.Agent`.
1377
1404
  * We want to avoid publicly re-exporting the actual interface,
@@ -1522,75 +1549,6 @@ type TransferProgressEvent = {
1522
1549
  //#region src/util/toWebResourceLike.d.ts
1523
1550
  declare const toWebResourceLike: (request: PipelineRequest) => WebResourceLike;
1524
1551
  //#endregion
1525
- //#region ../shared/dist/index.d.ts
1526
- //#region src/models/azure/BinaryOperator.d.ts
1527
- declare enum BinaryOperator {
1528
- eq = "eq",
1529
- ge = "ge",
1530
- gt = "gt",
1531
- le = "le",
1532
- lt = "lt",
1533
- ne = "ne",
1534
- }
1535
- //#endregion
1536
- //#region src/models/azure/Literal.d.ts
1537
-
1538
- //#endregion
1539
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/observable-like.d.ts
1540
- declare global {
1541
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1542
- interface SymbolConstructor {
1543
- readonly observable: symbol;
1544
- }
1545
- }
1546
-
1547
- /**
1548
- @remarks
1549
- The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
1550
- As well, some guidance on making an `Observable` to not include `closed` property.
1551
- @see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
1552
- @see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
1553
- @see https://github.com/benlesh/symbol-observable#making-an-object-observable
1554
-
1555
- @category Observable
1556
- */
1557
-
1558
- //#endregion
1559
- //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/optional-keys-of.d.ts
1560
- /**
1561
- Extract all optional keys from the given type.
1562
-
1563
- This is useful when you want to create a new type that contains different type values for the optional keys only.
1564
-
1565
- @example
1566
- ```
1567
- import type {OptionalKeysOf, Except} from 'type-fest';
1568
-
1569
- interface User {
1570
- name: string;
1571
- surname: string;
1572
-
1573
- luckyNumber?: number;
1574
- }
1575
-
1576
- const REMOVE_FIELD = Symbol('remove field symbol');
1577
- type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
1578
- [Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
1579
- };
1580
-
1581
- const update1: UpdateOperation<User> = {
1582
- name: 'Alice'
1583
- };
1584
-
1585
- const update2: UpdateOperation<User> = {
1586
- name: 'Bob',
1587
- luckyNumber: REMOVE_FIELD
1588
- };
1589
- ```
1590
-
1591
- @category Utilities
1592
- */
1593
- //#endregion
1594
1552
  //#region src/models/tableFilter/Clause.d.ts
1595
1553
  interface Clause {
1596
1554
  key: string;
package/dist/index.js CHANGED
@@ -68,7 +68,7 @@ const getAzureErrorXml = (errorCode, errorMessage) => html`<?xml version="1.0" e
68
68
  </Error>`;
69
69
 
70
70
  //#endregion
71
- //#region ../../node_modules/.pnpm/@typespec+ts-http-runtime@0.3.0/node_modules/@typespec/ts-http-runtime/dist/browser/httpHeaders.js
71
+ //#region ../../node_modules/.pnpm/@typespec+ts-http-runtime@0.3.1/node_modules/@typespec/ts-http-runtime/dist/browser/httpHeaders.js
72
72
  function normalizeName(name) {
73
73
  return name.toLowerCase();
74
74
  }
@@ -76,6 +76,7 @@ function* headerIterator(map) {
76
76
  for (const entry of map.values()) yield [entry.name, entry.value];
77
77
  }
78
78
  var HttpHeadersImpl = class {
79
+ _headersMap;
79
80
  constructor(rawHeaders) {
80
81
  this._headersMap = /* @__PURE__ */ new Map();
81
82
  if (rawHeaders) for (const headerName of Object.keys(rawHeaders)) this.set(headerName, rawHeaders[headerName]);
@@ -98,8 +99,7 @@ var HttpHeadersImpl = class {
98
99
  * @param name - The name of the header. This value is case-insensitive.
99
100
  */
100
101
  get(name) {
101
- var _a$1;
102
- return (_a$1 = this._headersMap.get(normalizeName(name))) === null || _a$1 === void 0 ? void 0 : _a$1.value;
102
+ return this._headersMap.get(normalizeName(name))?.value;
103
103
  }
104
104
  /**
105
105
  * Get whether or not this header collection contains a header entry for the provided header name.
@@ -146,7 +146,7 @@ function createHttpHeaders$1(rawHeaders) {
146
146
  }
147
147
 
148
148
  //#endregion
149
- //#region ../../node_modules/.pnpm/@typespec+ts-http-runtime@0.3.0/node_modules/@typespec/ts-http-runtime/dist/browser/util/uuidUtils.common.js
149
+ //#region ../../node_modules/.pnpm/@typespec+ts-http-runtime@0.3.1/node_modules/@typespec/ts-http-runtime/dist/browser/util/uuidUtils.common.js
150
150
  /**
151
151
  * Generated Universally Unique Identifier
152
152
  *
@@ -165,9 +165,8 @@ function generateUUID() {
165
165
  }
166
166
 
167
167
  //#endregion
168
- //#region ../../node_modules/.pnpm/@typespec+ts-http-runtime@0.3.0/node_modules/@typespec/ts-http-runtime/dist/browser/util/uuidUtils.js
169
- var _a;
170
- const uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : generateUUID;
168
+ //#region ../../node_modules/.pnpm/@typespec+ts-http-runtime@0.3.1/node_modules/@typespec/ts-http-runtime/dist/browser/util/uuidUtils.js
169
+ const uuidFunction = typeof globalThis?.crypto?.randomUUID === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : generateUUID;
171
170
  /**
172
171
  * Generated Universally Unique Identifier
173
172
  *
@@ -178,27 +177,45 @@ function randomUUID() {
178
177
  }
179
178
 
180
179
  //#endregion
181
- //#region ../../node_modules/.pnpm/@typespec+ts-http-runtime@0.3.0/node_modules/@typespec/ts-http-runtime/dist/browser/pipelineRequest.js
180
+ //#region ../../node_modules/.pnpm/@typespec+ts-http-runtime@0.3.1/node_modules/@typespec/ts-http-runtime/dist/browser/pipelineRequest.js
182
181
  var PipelineRequestImpl = class {
182
+ url;
183
+ method;
184
+ headers;
185
+ timeout;
186
+ withCredentials;
187
+ body;
188
+ multipartBody;
189
+ formData;
190
+ streamResponseStatusCodes;
191
+ enableBrowserStreams;
192
+ proxySettings;
193
+ disableKeepAlive;
194
+ abortSignal;
195
+ requestId;
196
+ allowInsecureConnection;
197
+ onUploadProgress;
198
+ onDownloadProgress;
199
+ requestOverrides;
200
+ authSchemes;
183
201
  constructor(options) {
184
- var _a$1, _b, _c, _d, _e, _f, _g;
185
202
  this.url = options.url;
186
203
  this.body = options.body;
187
- this.headers = (_a$1 = options.headers) !== null && _a$1 !== void 0 ? _a$1 : createHttpHeaders$1();
188
- this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET";
189
- this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0;
204
+ this.headers = options.headers ?? createHttpHeaders$1();
205
+ this.method = options.method ?? "GET";
206
+ this.timeout = options.timeout ?? 0;
190
207
  this.multipartBody = options.multipartBody;
191
208
  this.formData = options.formData;
192
- this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false;
209
+ this.disableKeepAlive = options.disableKeepAlive ?? false;
193
210
  this.proxySettings = options.proxySettings;
194
211
  this.streamResponseStatusCodes = options.streamResponseStatusCodes;
195
- this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false;
212
+ this.withCredentials = options.withCredentials ?? false;
196
213
  this.abortSignal = options.abortSignal;
197
214
  this.onUploadProgress = options.onUploadProgress;
198
215
  this.onDownloadProgress = options.onDownloadProgress;
199
216
  this.requestId = options.requestId || randomUUID();
200
- this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false;
201
- this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false;
217
+ this.allowInsecureConnection = options.allowInsecureConnection ?? false;
218
+ this.enableBrowserStreams = options.enableBrowserStreams ?? false;
202
219
  this.requestOverrides = options.requestOverrides;
203
220
  this.authSchemes = options.authSchemes;
204
221
  }
@@ -213,7 +230,7 @@ function createPipelineRequest$1(options) {
213
230
  }
214
231
 
215
232
  //#endregion
216
- //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.22.0/node_modules/@azure/core-rest-pipeline/dist/browser/httpHeaders.js
233
+ //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.22.1/node_modules/@azure/core-rest-pipeline/dist/browser/httpHeaders.js
217
234
  /**
218
235
  * Creates an object that satisfies the `HttpHeaders` interface.
219
236
  * @param rawHeaders - A simple object representing initial headers
@@ -223,7 +240,7 @@ function createHttpHeaders(rawHeaders) {
223
240
  }
224
241
 
225
242
  //#endregion
226
- //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.22.0/node_modules/@azure/core-rest-pipeline/dist/browser/pipelineRequest.js
243
+ //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.22.1/node_modules/@azure/core-rest-pipeline/dist/browser/pipelineRequest.js
227
244
  /**
228
245
  * Creates a new pipeline request with the given options.
229
246
  * This method is to allow for the easy setting of default values and not required.
@@ -234,7 +251,7 @@ function createPipelineRequest(options) {
234
251
  }
235
252
 
236
253
  //#endregion
237
- //#region ../../node_modules/.pnpm/@azure+core-http-compat@2.3.0/node_modules/@azure/core-http-compat/dist/browser/util.js
254
+ //#region ../../node_modules/.pnpm/@azure+core-http-compat@2.3.1/node_modules/@azure/core-http-compat/dist/browser/util.js
238
255
  const originalRequestSymbol = Symbol("Original PipelineRequest");
239
256
  const originalClientRequestSymbol = Symbol.for("@azure/core-client original request");
240
257
  /**
@@ -256,6 +273,7 @@ function getHeaderKey(headerName) {
256
273
  * A collection of HTTP header key/value pairs.
257
274
  */
258
275
  var HttpHeaders = class HttpHeaders {
276
+ _headersMap;
259
277
  constructor(rawHeaders) {
260
278
  this._headersMap = {};
261
279
  if (rawHeaders) for (const headerName in rawHeaders) this.set(headerName, rawHeaders[headerName]);
@@ -409,8 +427,7 @@ var MockBlobBatchClient = class {
409
427
  let subResponsesSucceededCount = 0;
410
428
  let subResponsesFailedCount = 0;
411
429
  for (const url of urls) {
412
- const urlParts = new URL(url);
413
- const pathSegments = urlParts.pathname.split("/").filter(Boolean);
430
+ const pathSegments = new URL(url).pathname.split("/").filter(Boolean);
414
431
  if (pathSegments.length < 2) {
415
432
  const errorCode = "InvalidUri";
416
433
  const statusMessage = "Invalid blob URL format.";
@@ -636,8 +653,7 @@ var MockBlobClient = class {
636
653
  throw new Error("Method not implemented.");
637
654
  }
638
655
  beginCopyFromURL(copySource) {
639
- const url = new URL(copySource);
640
- const pathSegments = url.pathname.split("/").filter(Boolean);
656
+ const pathSegments = new URL(copySource).pathname.split("/").filter(Boolean);
641
657
  if (pathSegments.length < 2) throw new MockRestError("Invalid copy source URL format", 400);
642
658
  const sourceContainerName = pathSegments[0];
643
659
  const sourceBlobName = pathSegments.slice(1).join("/");
@@ -1172,9 +1188,7 @@ const parseClause = (rawClause) => {
1172
1188
  //#endregion
1173
1189
  //#region src/util/tableFilter/createTableFilterPredicate.ts
1174
1190
  const createTableFilterPredicate = (filter) => {
1175
- const normalizedFilter = filter.replaceAll(String.raw`(`, " ").replaceAll(String.raw`)`, "");
1176
- const andGroups = normalizedFilter.split(/\s+and\s+/i).filter(Boolean);
1177
- const orGroups = andGroups.map((group) => group.split(/\s+or\s+/i).filter(Boolean));
1191
+ const orGroups = filter.replaceAll(String.raw`(`, " ").replaceAll(String.raw`)`, "").split(/\s+and\s+/i).filter(Boolean).map((group) => group.split(/\s+or\s+/i).filter(Boolean));
1178
1192
  return (entity) => {
1179
1193
  for (const group of orGroups) {
1180
1194
  let isGroupMatched = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-mock",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "A library that contains azure mock classes.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/Esposter/Esposter#readme",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "scripts": {
25
25
  "build": "pnpm export:gen && rolldown --config rolldown.config.ts",
26
- "test": "NODE_OPTIONS=--max-old-space-size=8192 vitest",
26
+ "test": "vitest",
27
27
  "coverage": "vitest run --coverage",
28
28
  "lint": "oxlint && eslint .",
29
29
  "lint:fix": "oxlint --fix && eslint --fix .",
@@ -31,10 +31,10 @@
31
31
  "export:gen": "ctix build --config ../configuration/.ctirc-ts"
32
32
  },
33
33
  "devDependencies": {
34
- "@azure/core-http-compat": "^2.3.0",
35
- "@azure/core-rest-pipeline": "^1.22.0",
34
+ "@azure/core-http-compat": "^2.3.1",
35
+ "@azure/core-rest-pipeline": "^1.22.1",
36
36
  "@azure/data-tables": "^13.3.1",
37
37
  "@azure/storage-blob": "^12.28.0"
38
38
  },
39
- "gitHead": "1765c0d90ecc03c94e942d88b8d8da962a8f53bc"
39
+ "gitHead": "bf7676c2df907ab50a35ca2910abfcf237983a16"
40
40
  }