azure-mock 2.15.0 → 2.16.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.
- package/dist/index.d.ts +54 -92
- package/dist/index.js +50323 -6312
- package/package.json +10 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { MapValue } from "@esposter/shared";
|
|
2
|
+
import { BinaryOperator, Clause } from "@esposter/db-schema";
|
|
1
3
|
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
4
|
import { CreateTableEntityResponse, GetAccessPolicyResponse, GetTableEntityResponse, ListTableEntitiesOptions, TableClient, TableDeleteEntityHeaders, TableEntity, TableEntityResult, TableEntityResultPage, TableMergeEntityHeaders, TableSetAccessPolicyHeaders, TableTransactionResponse, UpdateMode } from "@azure/data-tables";
|
|
3
5
|
|
|
@@ -8,49 +10,6 @@ type BlobHierarchyItem = (BlobItem & {
|
|
|
8
10
|
kind: "prefix";
|
|
9
11
|
});
|
|
10
12
|
//#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/SearchOperator.d.ts
|
|
23
|
-
declare enum SearchOperator {
|
|
24
|
-
arrayContains = "arrayContains",
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/models/azure/SerializableValue.d.ts
|
|
28
|
-
|
|
29
|
-
type SerializableValue = boolean | Date | null | number | string;
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/models/azure/Clause.d.ts
|
|
32
|
-
type Clause = {
|
|
33
|
-
key: string;
|
|
34
|
-
not?: boolean;
|
|
35
|
-
} & ({
|
|
36
|
-
operator: BinaryOperator;
|
|
37
|
-
value: SerializableValue;
|
|
38
|
-
} | {
|
|
39
|
-
operator: Exclude<SearchOperator, SearchOperator.arrayContains>;
|
|
40
|
-
value: SerializableValue;
|
|
41
|
-
} | {
|
|
42
|
-
operator: SearchOperator.arrayContains;
|
|
43
|
-
value: SerializableValue[];
|
|
44
|
-
});
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/models/azure/UnaryOperator.d.ts
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/util/types/MapValue.d.ts
|
|
50
|
-
type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/util/types/TupleSplitHead.d.ts
|
|
53
|
-
//#endregion
|
|
54
13
|
//#region src/store/MockContainerDatabase.d.ts
|
|
55
14
|
declare const MockContainerDatabase: Map<string, Map<string, Buffer>>;
|
|
56
15
|
//#endregion
|
|
@@ -68,7 +27,7 @@ declare class MockBlobBatchClient implements BlobBatchClient {
|
|
|
68
27
|
getContainer(containerName: string): MapValue<typeof MockContainerDatabase>;
|
|
69
28
|
}
|
|
70
29
|
//#endregion
|
|
71
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
30
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/is-any.d.ts
|
|
72
31
|
/**
|
|
73
32
|
Returns a boolean for whether the given type is `any`.
|
|
74
33
|
|
|
@@ -97,9 +56,9 @@ const anyA = get(anyObject, 'a');
|
|
|
97
56
|
@category Type Guard
|
|
98
57
|
@category Utilities
|
|
99
58
|
*/
|
|
100
|
-
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
59
|
+
type IsAny<T$1> = 0 extends 1 & NoInfer<T$1> ? true : false;
|
|
101
60
|
//#endregion
|
|
102
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
61
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
103
62
|
/**
|
|
104
63
|
Returns a boolean for whether the given key is an optional key of type.
|
|
105
64
|
|
|
@@ -140,9 +99,9 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
140
99
|
@category Type Guard
|
|
141
100
|
@category Utilities
|
|
142
101
|
*/
|
|
143
|
-
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;
|
|
102
|
+
type IsOptionalKeyOf<Type extends object, Key$1 extends keyof Type> = IsAny<Type | Key$1> extends true ? never : Key$1 extends keyof Type ? Type extends Record<Key$1, Type[Key$1]> ? false : true : false;
|
|
144
103
|
//#endregion
|
|
145
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
104
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
146
105
|
/**
|
|
147
106
|
Extract all optional keys from the given type.
|
|
148
107
|
|
|
@@ -180,7 +139,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
180
139
|
? (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`
|
|
181
140
|
: never;
|
|
182
141
|
//#endregion
|
|
183
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
142
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
184
143
|
/**
|
|
185
144
|
Extract all required keys from the given type.
|
|
186
145
|
|
|
@@ -208,7 +167,7 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
|
|
|
208
167
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
209
168
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
210
169
|
//#endregion
|
|
211
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
170
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/is-never.d.ts
|
|
212
171
|
/**
|
|
213
172
|
Returns a boolean for whether the given type is `never`.
|
|
214
173
|
|
|
@@ -250,9 +209,9 @@ endIfEqual('abc', '123');
|
|
|
250
209
|
@category Type Guard
|
|
251
210
|
@category Utilities
|
|
252
211
|
*/
|
|
253
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
212
|
+
type IsNever<T$1> = [T$1] extends [never] ? true : false;
|
|
254
213
|
//#endregion
|
|
255
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
214
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/if.d.ts
|
|
256
215
|
/**
|
|
257
216
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
258
217
|
|
|
@@ -312,36 +271,7 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
312
271
|
*/
|
|
313
272
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
314
273
|
//#endregion
|
|
315
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
316
|
-
/**
|
|
317
|
-
Returns a boolean for whether the two given types are equal.
|
|
318
|
-
|
|
319
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
320
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
321
|
-
|
|
322
|
-
Use-cases:
|
|
323
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
324
|
-
|
|
325
|
-
@example
|
|
326
|
-
```
|
|
327
|
-
import type {IsEqual} from 'type-fest';
|
|
328
|
-
|
|
329
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
330
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
331
|
-
type Includes<Value extends readonly any[], Item> =
|
|
332
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
333
|
-
? IsEqual<Value[0], Item> extends true
|
|
334
|
-
? true
|
|
335
|
-
: Includes<rest, Item>
|
|
336
|
-
: false;
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
@category Type Guard
|
|
340
|
-
@category Utilities
|
|
341
|
-
*/
|
|
342
|
-
type IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
343
|
-
//#endregion
|
|
344
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/simplify.d.ts
|
|
274
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/simplify.d.ts
|
|
345
275
|
/**
|
|
346
276
|
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.
|
|
347
277
|
|
|
@@ -399,9 +329,40 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
399
329
|
@see SimplifyDeep
|
|
400
330
|
@category Object
|
|
401
331
|
*/
|
|
402
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
332
|
+
type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
|
|
403
333
|
//#endregion
|
|
404
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
334
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/is-equal.d.ts
|
|
335
|
+
/**
|
|
336
|
+
Returns a boolean for whether the two given types are equal.
|
|
337
|
+
|
|
338
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
339
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
340
|
+
|
|
341
|
+
Use-cases:
|
|
342
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
343
|
+
|
|
344
|
+
@example
|
|
345
|
+
```
|
|
346
|
+
import type {IsEqual} from 'type-fest';
|
|
347
|
+
|
|
348
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
349
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
350
|
+
type Includes<Value extends readonly any[], Item> =
|
|
351
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
352
|
+
? IsEqual<Value[0], Item> extends true
|
|
353
|
+
? true
|
|
354
|
+
: Includes<rest, Item>
|
|
355
|
+
: false;
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
@category Type Guard
|
|
359
|
+
@category Utilities
|
|
360
|
+
*/
|
|
361
|
+
type IsEqual<A, B> = [A, B] extends [infer AA, infer BB] ? [AA] extends [never] ? [BB] extends [never] ? true : false : [BB] extends [never] ? false : _IsEqual<AA, BB> : false;
|
|
362
|
+
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
363
|
+
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
405
366
|
/**
|
|
406
367
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
407
368
|
|
|
@@ -494,7 +455,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
494
455
|
*/
|
|
495
456
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
496
457
|
//#endregion
|
|
497
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
458
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
498
459
|
/**
|
|
499
460
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
500
461
|
|
|
@@ -542,7 +503,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
542
503
|
*/
|
|
543
504
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
544
505
|
//#endregion
|
|
545
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
506
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/merge.d.ts
|
|
546
507
|
// Merges two objects without worrying about index signatures.
|
|
547
508
|
type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
|
|
548
509
|
|
|
@@ -582,7 +543,8 @@ export type FooBar = Merge<Foo, Bar>;
|
|
|
582
543
|
*/
|
|
583
544
|
type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
584
545
|
//#endregion
|
|
585
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
546
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/internal/object.d.ts
|
|
547
|
+
|
|
586
548
|
/**
|
|
587
549
|
Merges user specified options with default options.
|
|
588
550
|
|
|
@@ -635,9 +597,9 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
635
597
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
636
598
|
```
|
|
637
599
|
*/
|
|
638
|
-
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>>>>;
|
|
600
|
+
type ApplyDefaultOptions<Options$1 extends object, Defaults extends Simplify<Omit<Required<Options$1>, RequiredKeysOf<Options$1>> & Partial<Record<RequiredKeysOf<Options$1>, never>>>, SpecifiedOptions extends Options$1> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options$1> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options$1>>>>;
|
|
639
601
|
//#endregion
|
|
640
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
602
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/except.d.ts
|
|
641
603
|
/**
|
|
642
604
|
Filter out keys from an object.
|
|
643
605
|
|
|
@@ -665,7 +627,7 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
665
627
|
|
|
666
628
|
@see {Except}
|
|
667
629
|
*/
|
|
668
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
630
|
+
type Filter<KeyType$1, ExcludeType> = IsEqual<KeyType$1, ExcludeType> extends true ? never : (KeyType$1 extends ExcludeType ? never : KeyType$1);
|
|
669
631
|
type ExceptOptions = {
|
|
670
632
|
/**
|
|
671
633
|
Disallow assigning non-specified properties.
|
|
@@ -731,8 +693,8 @@ type PostPayload = Except<UserData, 'email'>;
|
|
|
731
693
|
|
|
732
694
|
@category Object
|
|
733
695
|
*/
|
|
734
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
735
|
-
type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
|
|
696
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options$1 extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options$1>>;
|
|
697
|
+
type _Except<ObjectType, KeysType extends keyof ObjectType, Options$1 extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options$1['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
|
|
736
698
|
//#endregion
|
|
737
699
|
//#region src/models/MockBlobClient.d.ts
|
|
738
700
|
declare class MockBlobClient implements Except<BlobClient, "accountName"> {
|