azure-mock 2.15.1 → 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 -93
- package/dist/index.js +34462 -52937
- package/package.json +10 -7
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,14 +10,6 @@ type BlobHierarchyItem = (BlobItem & {
|
|
|
8
10
|
kind: "prefix";
|
|
9
11
|
});
|
|
10
12
|
//#endregion
|
|
11
|
-
//#region ../shared/dist/index.d.ts
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/util/types/MapValue.d.ts
|
|
15
|
-
type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/util/types/TupleSplitHead.d.ts
|
|
18
|
-
//#endregion
|
|
19
13
|
//#region src/store/MockContainerDatabase.d.ts
|
|
20
14
|
declare const MockContainerDatabase: Map<string, Map<string, Buffer>>;
|
|
21
15
|
//#endregion
|
|
@@ -33,7 +27,7 @@ declare class MockBlobBatchClient implements BlobBatchClient {
|
|
|
33
27
|
getContainer(containerName: string): MapValue<typeof MockContainerDatabase>;
|
|
34
28
|
}
|
|
35
29
|
//#endregion
|
|
36
|
-
//#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
|
|
37
31
|
/**
|
|
38
32
|
Returns a boolean for whether the given type is `any`.
|
|
39
33
|
|
|
@@ -62,9 +56,9 @@ const anyA = get(anyObject, 'a');
|
|
|
62
56
|
@category Type Guard
|
|
63
57
|
@category Utilities
|
|
64
58
|
*/
|
|
65
|
-
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
59
|
+
type IsAny<T$1> = 0 extends 1 & NoInfer<T$1> ? true : false;
|
|
66
60
|
//#endregion
|
|
67
|
-
//#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
|
|
68
62
|
/**
|
|
69
63
|
Returns a boolean for whether the given key is an optional key of type.
|
|
70
64
|
|
|
@@ -105,9 +99,9 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
105
99
|
@category Type Guard
|
|
106
100
|
@category Utilities
|
|
107
101
|
*/
|
|
108
|
-
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;
|
|
109
103
|
//#endregion
|
|
110
|
-
//#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
|
|
111
105
|
/**
|
|
112
106
|
Extract all optional keys from the given type.
|
|
113
107
|
|
|
@@ -145,7 +139,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
145
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`
|
|
146
140
|
: never;
|
|
147
141
|
//#endregion
|
|
148
|
-
//#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
|
|
149
143
|
/**
|
|
150
144
|
Extract all required keys from the given type.
|
|
151
145
|
|
|
@@ -173,7 +167,7 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
|
|
|
173
167
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
174
168
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
175
169
|
//#endregion
|
|
176
|
-
//#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
|
|
177
171
|
/**
|
|
178
172
|
Returns a boolean for whether the given type is `never`.
|
|
179
173
|
|
|
@@ -215,9 +209,9 @@ endIfEqual('abc', '123');
|
|
|
215
209
|
@category Type Guard
|
|
216
210
|
@category Utilities
|
|
217
211
|
*/
|
|
218
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
212
|
+
type IsNever<T$1> = [T$1] extends [never] ? true : false;
|
|
219
213
|
//#endregion
|
|
220
|
-
//#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
|
|
221
215
|
/**
|
|
222
216
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
223
217
|
|
|
@@ -277,36 +271,7 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
277
271
|
*/
|
|
278
272
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
279
273
|
//#endregion
|
|
280
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
281
|
-
/**
|
|
282
|
-
Returns a boolean for whether the two given types are equal.
|
|
283
|
-
|
|
284
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
285
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
286
|
-
|
|
287
|
-
Use-cases:
|
|
288
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
289
|
-
|
|
290
|
-
@example
|
|
291
|
-
```
|
|
292
|
-
import type {IsEqual} from 'type-fest';
|
|
293
|
-
|
|
294
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
295
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
296
|
-
type Includes<Value extends readonly any[], Item> =
|
|
297
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
298
|
-
? IsEqual<Value[0], Item> extends true
|
|
299
|
-
? true
|
|
300
|
-
: Includes<rest, Item>
|
|
301
|
-
: false;
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
@category Type Guard
|
|
305
|
-
@category Utilities
|
|
306
|
-
*/
|
|
307
|
-
type IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
308
|
-
//#endregion
|
|
309
|
-
//#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
|
|
310
275
|
/**
|
|
311
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.
|
|
312
277
|
|
|
@@ -364,9 +329,40 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
364
329
|
@see SimplifyDeep
|
|
365
330
|
@category Object
|
|
366
331
|
*/
|
|
367
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
332
|
+
type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
|
|
333
|
+
//#endregion
|
|
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;
|
|
368
364
|
//#endregion
|
|
369
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0
|
|
365
|
+
//#region ../../node_modules/.pnpm/type-fest@5.1.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
370
366
|
/**
|
|
371
367
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
372
368
|
|
|
@@ -459,7 +455,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
459
455
|
*/
|
|
460
456
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
461
457
|
//#endregion
|
|
462
|
-
//#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
|
|
463
459
|
/**
|
|
464
460
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
465
461
|
|
|
@@ -507,7 +503,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
507
503
|
*/
|
|
508
504
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
509
505
|
//#endregion
|
|
510
|
-
//#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
|
|
511
507
|
// Merges two objects without worrying about index signatures.
|
|
512
508
|
type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
|
|
513
509
|
|
|
@@ -547,7 +543,8 @@ export type FooBar = Merge<Foo, Bar>;
|
|
|
547
543
|
*/
|
|
548
544
|
type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
549
545
|
//#endregion
|
|
550
|
-
//#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
|
+
|
|
551
548
|
/**
|
|
552
549
|
Merges user specified options with default options.
|
|
553
550
|
|
|
@@ -600,9 +597,9 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
600
597
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
601
598
|
```
|
|
602
599
|
*/
|
|
603
|
-
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>>>>;
|
|
604
601
|
//#endregion
|
|
605
|
-
//#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
|
|
606
603
|
/**
|
|
607
604
|
Filter out keys from an object.
|
|
608
605
|
|
|
@@ -630,7 +627,7 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
630
627
|
|
|
631
628
|
@see {Except}
|
|
632
629
|
*/
|
|
633
|
-
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);
|
|
634
631
|
type ExceptOptions = {
|
|
635
632
|
/**
|
|
636
633
|
Disallow assigning non-specified properties.
|
|
@@ -696,8 +693,8 @@ type PostPayload = Except<UserData, 'email'>;
|
|
|
696
693
|
|
|
697
694
|
@category Object
|
|
698
695
|
*/
|
|
699
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
700
|
-
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>> : {});
|
|
701
698
|
//#endregion
|
|
702
699
|
//#region src/models/MockBlobClient.d.ts
|
|
703
700
|
declare class MockBlobClient implements Except<BlobClient, "accountName"> {
|
|
@@ -1538,42 +1535,6 @@ type TransferProgressEvent = {
|
|
|
1538
1535
|
//#region src/services/blob/toWebResourceLike.d.ts
|
|
1539
1536
|
declare const toWebResourceLike: (request: PipelineRequest) => WebResourceLike;
|
|
1540
1537
|
//#endregion
|
|
1541
|
-
//#region ../db-schema/dist/index.d.ts
|
|
1542
|
-
|
|
1543
|
-
type SerializableValue = boolean | Date | null | number | string;
|
|
1544
|
-
//#endregion
|
|
1545
|
-
//#region src/models/azure/BinaryOperator.d.ts
|
|
1546
|
-
declare enum BinaryOperator {
|
|
1547
|
-
eq = "eq",
|
|
1548
|
-
ge = "ge",
|
|
1549
|
-
gt = "gt",
|
|
1550
|
-
le = "le",
|
|
1551
|
-
lt = "lt",
|
|
1552
|
-
ne = "ne",
|
|
1553
|
-
}
|
|
1554
|
-
//#endregion
|
|
1555
|
-
//#region src/models/azure/search/SearchOperator.d.ts
|
|
1556
|
-
declare enum SearchOperator {
|
|
1557
|
-
arrayContains = "arrayContains",
|
|
1558
|
-
}
|
|
1559
|
-
//#endregion
|
|
1560
|
-
//#region src/models/azure/Clause.d.ts
|
|
1561
|
-
type Clause = {
|
|
1562
|
-
key: string;
|
|
1563
|
-
not?: boolean;
|
|
1564
|
-
} & ({
|
|
1565
|
-
operator: BinaryOperator;
|
|
1566
|
-
value: SerializableValue;
|
|
1567
|
-
} | {
|
|
1568
|
-
operator: Exclude<SearchOperator, SearchOperator.arrayContains>;
|
|
1569
|
-
value: SerializableValue;
|
|
1570
|
-
} | {
|
|
1571
|
-
operator: SearchOperator.arrayContains;
|
|
1572
|
-
value: SerializableValue[];
|
|
1573
|
-
});
|
|
1574
|
-
//#endregion
|
|
1575
|
-
//#region src/models/azure/UnaryOperator.d.ts
|
|
1576
|
-
//#endregion
|
|
1577
1538
|
//#region src/services/table/applyTableFilter.d.ts
|
|
1578
1539
|
declare const applyTableFilter: <T extends Record<string, unknown>>(entities: TableEntity<T>[], clauses: Clause[]) => TableEntity<T>[];
|
|
1579
1540
|
//#endregion
|