azure-mock 2.16.0 → 2.17.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/LICENSE +201 -201
- package/README.md +45 -45
- package/dist/index.d.ts +173 -81
- package/dist/index.js +263 -33
- package/package.json +9 -7
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,70 @@
|
|
|
1
1
|
import { MapValue } from "@esposter/shared";
|
|
2
2
|
import { BinaryOperator, Clause } from "@esposter/db-schema";
|
|
3
|
-
import {
|
|
3
|
+
import { EventGridEvent, EventGridPublisherClient } from "@azure/eventgrid";
|
|
4
4
|
import { CreateTableEntityResponse, GetAccessPolicyResponse, GetTableEntityResponse, ListTableEntitiesOptions, TableClient, TableDeleteEntityHeaders, TableEntity, TableEntityResult, TableEntityResultPage, TableMergeEntityHeaders, TableSetAccessPolicyHeaders, TableTransactionResponse, UpdateMode } from "@azure/data-tables";
|
|
5
|
+
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";
|
|
6
|
+
import { QueueClearMessagesResponse, QueueClient, QueueCreateIfNotExistsResponse, QueueCreateOptions, QueueCreateResponse, QueueDeleteIfExistsResponse, QueueDeleteMessageResponse, QueueDeleteResponse, QueueGetAccessPolicyResponse, QueueGetPropertiesResponse, QueueItem, QueuePeekMessagesOptions, QueuePeekMessagesResponse, QueueReceiveMessageOptions, QueueReceiveMessageResponse, QueueSendMessageOptions, QueueSendMessageResponse, QueueServiceProperties, QueueSetAccessPolicyResponse, QueueSetMetadataResponse, QueueUpdateMessageResponse, SignedIdentifier } from "@azure/storage-queue";
|
|
5
7
|
|
|
6
|
-
//#region src/models/
|
|
8
|
+
//#region src/models/MockRestError.d.ts
|
|
9
|
+
declare class MockRestError extends Error {
|
|
10
|
+
statusCode: number;
|
|
11
|
+
constructor(message: string, statusCode: number);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/models/PageSettings.d.ts
|
|
15
|
+
/**
|
|
16
|
+
* An interface that tracks the settings for paged iteration
|
|
17
|
+
*/
|
|
18
|
+
interface PageSettings {
|
|
19
|
+
/**
|
|
20
|
+
* The token that keeps track of where to continue the iterator
|
|
21
|
+
*/
|
|
22
|
+
continuationToken?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The size of the page during paged iteration
|
|
25
|
+
*/
|
|
26
|
+
maxPageSize?: number;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/models/PagedAsyncIterableIterator.d.ts
|
|
30
|
+
/**
|
|
31
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
32
|
+
*/
|
|
33
|
+
interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
|
|
34
|
+
/**
|
|
35
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
36
|
+
*/
|
|
37
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
38
|
+
/**
|
|
39
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
40
|
+
*/
|
|
41
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
42
|
+
/**
|
|
43
|
+
* The next method, part of the iteration protocol
|
|
44
|
+
*/
|
|
45
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/store/MockContainerDatabase.d.ts
|
|
49
|
+
declare const MockContainerDatabase: Map<string, Map<string, Buffer>>;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/store/MockEventGridDatabase.d.ts
|
|
52
|
+
declare const MockEventGridDatabase: Map<string, EventGridEvent<unknown>[]>;
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/store/MockQueueDatabase.d.ts
|
|
55
|
+
declare const MockQueueDatabase: Map<string, string[]>;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/store/MockTableDatabase.d.ts
|
|
58
|
+
declare const MockTableDatabase: Map<string, Map<string, TableEntity>>;
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/models/container/BlobHierarchyItem.d.ts
|
|
7
61
|
type BlobHierarchyItem = (BlobItem & {
|
|
8
62
|
kind: "blob";
|
|
9
63
|
}) | (BlobPrefix & {
|
|
10
64
|
kind: "prefix";
|
|
11
65
|
});
|
|
12
66
|
//#endregion
|
|
13
|
-
//#region src/
|
|
14
|
-
declare const MockContainerDatabase: Map<string, Map<string, Buffer>>;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/models/MockBlobBatchClient.d.ts
|
|
67
|
+
//#region src/models/container/MockBlobBatchClient.d.ts
|
|
17
68
|
declare class MockBlobBatchClient implements BlobBatchClient {
|
|
18
69
|
url: string;
|
|
19
70
|
constructor(url: string);
|
|
@@ -27,7 +78,7 @@ declare class MockBlobBatchClient implements BlobBatchClient {
|
|
|
27
78
|
getContainer(containerName: string): MapValue<typeof MockContainerDatabase>;
|
|
28
79
|
}
|
|
29
80
|
//#endregion
|
|
30
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
81
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/is-any.d.ts
|
|
31
82
|
/**
|
|
32
83
|
Returns a boolean for whether the given type is `any`.
|
|
33
84
|
|
|
@@ -56,9 +107,9 @@ const anyA = get(anyObject, 'a');
|
|
|
56
107
|
@category Type Guard
|
|
57
108
|
@category Utilities
|
|
58
109
|
*/
|
|
59
|
-
type IsAny<T
|
|
110
|
+
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
60
111
|
//#endregion
|
|
61
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
112
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
62
113
|
/**
|
|
63
114
|
Returns a boolean for whether the given key is an optional key of type.
|
|
64
115
|
|
|
@@ -101,7 +152,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
101
152
|
*/
|
|
102
153
|
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;
|
|
103
154
|
//#endregion
|
|
104
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
155
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
105
156
|
/**
|
|
106
157
|
Extract all optional keys from the given type.
|
|
107
158
|
|
|
@@ -139,7 +190,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
139
190
|
? (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`
|
|
140
191
|
: never;
|
|
141
192
|
//#endregion
|
|
142
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
193
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/required-keys-of.d.ts
|
|
143
194
|
/**
|
|
144
195
|
Extract all required keys from the given type.
|
|
145
196
|
|
|
@@ -167,7 +218,7 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
|
|
|
167
218
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
168
219
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
169
220
|
//#endregion
|
|
170
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
221
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/is-never.d.ts
|
|
171
222
|
/**
|
|
172
223
|
Returns a boolean for whether the given type is `never`.
|
|
173
224
|
|
|
@@ -209,9 +260,9 @@ endIfEqual('abc', '123');
|
|
|
209
260
|
@category Type Guard
|
|
210
261
|
@category Utilities
|
|
211
262
|
*/
|
|
212
|
-
type IsNever<T
|
|
263
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
213
264
|
//#endregion
|
|
214
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
265
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/if.d.ts
|
|
215
266
|
/**
|
|
216
267
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
217
268
|
|
|
@@ -266,12 +317,47 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
266
317
|
//=> 'not equal'
|
|
267
318
|
```
|
|
268
319
|
|
|
320
|
+
Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
|
|
321
|
+
|
|
322
|
+
@example
|
|
323
|
+
```
|
|
324
|
+
import type {If, IsEqual, StringRepeat} from 'type-fest';
|
|
325
|
+
|
|
326
|
+
type HundredZeroes = StringRepeat<'0', 100>;
|
|
327
|
+
|
|
328
|
+
// The following implementation is not tail recursive
|
|
329
|
+
type Includes<S extends string, Char extends string> =
|
|
330
|
+
S extends `${infer First}${infer Rest}`
|
|
331
|
+
? If<IsEqual<First, Char>,
|
|
332
|
+
'found',
|
|
333
|
+
Includes<Rest, Char>>
|
|
334
|
+
: 'not found';
|
|
335
|
+
|
|
336
|
+
// Hence, instantiations with long strings will fail
|
|
337
|
+
// @ts-expect-error
|
|
338
|
+
type Fails = Includes<HundredZeroes, '1'>;
|
|
339
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
340
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
341
|
+
|
|
342
|
+
// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
|
|
343
|
+
type IncludesWithoutIf<S extends string, Char extends string> =
|
|
344
|
+
S extends `${infer First}${infer Rest}`
|
|
345
|
+
? IsEqual<First, Char> extends true
|
|
346
|
+
? 'found'
|
|
347
|
+
: IncludesWithoutIf<Rest, Char>
|
|
348
|
+
: 'not found';
|
|
349
|
+
|
|
350
|
+
// Now, instantiations with long strings will work
|
|
351
|
+
type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
352
|
+
//=> 'not found'
|
|
353
|
+
```
|
|
354
|
+
|
|
269
355
|
@category Type Guard
|
|
270
356
|
@category Utilities
|
|
271
357
|
*/
|
|
272
358
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
273
359
|
//#endregion
|
|
274
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
360
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/simplify.d.ts
|
|
275
361
|
/**
|
|
276
362
|
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.
|
|
277
363
|
|
|
@@ -326,12 +412,12 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
326
412
|
```
|
|
327
413
|
|
|
328
414
|
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
329
|
-
@see SimplifyDeep
|
|
415
|
+
@see {@link SimplifyDeep}
|
|
330
416
|
@category Object
|
|
331
417
|
*/
|
|
332
|
-
type Simplify<T
|
|
418
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
333
419
|
//#endregion
|
|
334
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
420
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/is-equal.d.ts
|
|
335
421
|
/**
|
|
336
422
|
Returns a boolean for whether the two given types are equal.
|
|
337
423
|
|
|
@@ -362,7 +448,7 @@ type IsEqual<A, B> = [A, B] extends [infer AA, infer BB] ? [AA] extends [never]
|
|
|
362
448
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
363
449
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
364
450
|
//#endregion
|
|
365
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
451
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
366
452
|
/**
|
|
367
453
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
368
454
|
|
|
@@ -450,12 +536,12 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
450
536
|
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
451
537
|
```
|
|
452
538
|
|
|
453
|
-
@see PickIndexSignature
|
|
539
|
+
@see {@link PickIndexSignature}
|
|
454
540
|
@category Object
|
|
455
541
|
*/
|
|
456
542
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
457
543
|
//#endregion
|
|
458
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
544
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
459
545
|
/**
|
|
460
546
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
461
547
|
|
|
@@ -498,12 +584,12 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
498
584
|
// }
|
|
499
585
|
```
|
|
500
586
|
|
|
501
|
-
@see OmitIndexSignature
|
|
587
|
+
@see {@link OmitIndexSignature}
|
|
502
588
|
@category Object
|
|
503
589
|
*/
|
|
504
590
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
505
591
|
//#endregion
|
|
506
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
592
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/merge.d.ts
|
|
507
593
|
// Merges two objects without worrying about index signatures.
|
|
508
594
|
type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
|
|
509
595
|
|
|
@@ -543,8 +629,7 @@ export type FooBar = Merge<Foo, Bar>;
|
|
|
543
629
|
*/
|
|
544
630
|
type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
545
631
|
//#endregion
|
|
546
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
547
|
-
|
|
632
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/internal/object.d.ts
|
|
548
633
|
/**
|
|
549
634
|
Merges user specified options with default options.
|
|
550
635
|
|
|
@@ -597,9 +682,9 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
597
682
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
598
683
|
```
|
|
599
684
|
*/
|
|
600
|
-
type ApplyDefaultOptions<Options
|
|
685
|
+
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>>>>;
|
|
601
686
|
//#endregion
|
|
602
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
687
|
+
//#region ../../node_modules/.pnpm/type-fest@5.2.0/node_modules/type-fest/source/except.d.ts
|
|
603
688
|
/**
|
|
604
689
|
Filter out keys from an object.
|
|
605
690
|
|
|
@@ -693,10 +778,10 @@ type PostPayload = Except<UserData, 'email'>;
|
|
|
693
778
|
|
|
694
779
|
@category Object
|
|
695
780
|
*/
|
|
696
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options
|
|
697
|
-
type _Except<ObjectType, KeysType extends keyof ObjectType, Options
|
|
781
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
|
|
782
|
+
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>> : {});
|
|
698
783
|
//#endregion
|
|
699
|
-
//#region src/models/MockBlobClient.d.ts
|
|
784
|
+
//#region src/models/container/MockBlobClient.d.ts
|
|
700
785
|
declare class MockBlobClient implements Except<BlobClient, "accountName"> {
|
|
701
786
|
connectionString: string;
|
|
702
787
|
containerName: string;
|
|
@@ -738,7 +823,7 @@ declare class MockBlobClient implements Except<BlobClient, "accountName"> {
|
|
|
738
823
|
withVersion(): BlobClient;
|
|
739
824
|
}
|
|
740
825
|
//#endregion
|
|
741
|
-
//#region src/models/MockBlockBlobClient.d.ts
|
|
826
|
+
//#region src/models/container/MockBlockBlobClient.d.ts
|
|
742
827
|
declare class MockBlockBlobClient extends MockBlobClient implements Except<BlockBlobClient, "accountName"> {
|
|
743
828
|
commitBlockList(): Promise<BlockBlobCommitBlockListResponse>;
|
|
744
829
|
getBlockList(): Promise<BlockBlobGetBlockListResponse>;
|
|
@@ -753,41 +838,7 @@ declare class MockBlockBlobClient extends MockBlobClient implements Except<Block
|
|
|
753
838
|
uploadStream(): Promise<BlobUploadCommonResponse>;
|
|
754
839
|
}
|
|
755
840
|
//#endregion
|
|
756
|
-
//#region src/models/
|
|
757
|
-
/**
|
|
758
|
-
* An interface that tracks the settings for paged iteration
|
|
759
|
-
*/
|
|
760
|
-
interface PageSettings {
|
|
761
|
-
/**
|
|
762
|
-
* The token that keeps track of where to continue the iterator
|
|
763
|
-
*/
|
|
764
|
-
continuationToken?: string;
|
|
765
|
-
/**
|
|
766
|
-
* The size of the page during paged iteration
|
|
767
|
-
*/
|
|
768
|
-
maxPageSize?: number;
|
|
769
|
-
}
|
|
770
|
-
//#endregion
|
|
771
|
-
//#region src/models/PagedAsyncIterableIterator.d.ts
|
|
772
|
-
/**
|
|
773
|
-
* An interface that allows async iterable iteration both to completion and by page.
|
|
774
|
-
*/
|
|
775
|
-
interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
|
|
776
|
-
/**
|
|
777
|
-
* The connection to the async iterator, part of the iteration protocol
|
|
778
|
-
*/
|
|
779
|
-
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
780
|
-
/**
|
|
781
|
-
* Return an AsyncIterableIterator that works a page at a time
|
|
782
|
-
*/
|
|
783
|
-
byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
784
|
-
/**
|
|
785
|
-
* The next method, part of the iteration protocol
|
|
786
|
-
*/
|
|
787
|
-
next(): Promise<IteratorResult<TElement>>;
|
|
788
|
-
}
|
|
789
|
-
//#endregion
|
|
790
|
-
//#region src/models/MockContainerClient.d.ts
|
|
841
|
+
//#region src/models/container/MockContainerClient.d.ts
|
|
791
842
|
/**
|
|
792
843
|
* An in-memory mock of the Azure ContainerClient.
|
|
793
844
|
* It uses a Map to simulate blob storage.
|
|
@@ -837,16 +888,57 @@ declare class MockContainerClient implements Except<ContainerClient, "accountNam
|
|
|
837
888
|
private getBlobItemIterator;
|
|
838
889
|
}
|
|
839
890
|
//#endregion
|
|
840
|
-
//#region src/models/
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
891
|
+
//#region src/models/eventGrid/MockEventGridPublisherClient.d.ts
|
|
892
|
+
/**
|
|
893
|
+
* An in-memory mock of the Azure EventGridPublisherClient.
|
|
894
|
+
* It uses a Map to simulate event grid storage and correctly implements the EventGridPublisherClient interface.
|
|
895
|
+
*/
|
|
896
|
+
declare class MockEventGridPublisherClient implements Except<EventGridPublisherClient<"EventGrid">, "apiVersion" | "endpointUrl"> {
|
|
897
|
+
endpoint: string;
|
|
898
|
+
topicType: "EventGrid";
|
|
899
|
+
constructor(endpoint: string, topicType: "EventGrid");
|
|
900
|
+
send(newEvents: EventGridEvent<unknown>[]): Promise<void>;
|
|
844
901
|
}
|
|
845
902
|
//#endregion
|
|
846
|
-
//#region src/
|
|
847
|
-
|
|
903
|
+
//#region src/models/queue/MockQueueClient.d.ts
|
|
904
|
+
/**
|
|
905
|
+
* An in-memory mock of the Azure QueueClient.
|
|
906
|
+
* It uses a Map to simulate queue storage and correctly implements the QueueClient interface.
|
|
907
|
+
*
|
|
908
|
+
* @example
|
|
909
|
+
* const mockQueueClient = new MockQueueClient("", "hello world");
|
|
910
|
+
* await mockQueueClient.createIfNotExists();
|
|
911
|
+
* await mockQueueClient.sendMessage("hello world");
|
|
912
|
+
* const messages = await mockQueueClient.peekMessages();
|
|
913
|
+
*/
|
|
914
|
+
declare class MockQueueClient implements Except<QueueClient, "accountName"> {
|
|
915
|
+
connectionString: string;
|
|
916
|
+
name: string;
|
|
917
|
+
url: string;
|
|
918
|
+
get queue(): MapValue<typeof MockQueueDatabase>;
|
|
919
|
+
constructor(connectionString: string, queueName: string);
|
|
920
|
+
clearMessages(): Promise<QueueClearMessagesResponse>;
|
|
921
|
+
create(_options?: QueueCreateOptions): Promise<QueueCreateResponse>;
|
|
922
|
+
createIfNotExists(): Promise<QueueCreateIfNotExistsResponse>;
|
|
923
|
+
delete(): Promise<QueueDeleteResponse>;
|
|
924
|
+
deleteIfExists(): Promise<QueueDeleteIfExistsResponse>;
|
|
925
|
+
deleteMessage(): Promise<QueueDeleteMessageResponse>;
|
|
926
|
+
exists(): Promise<boolean>;
|
|
927
|
+
generateSasStringToSign(): string;
|
|
928
|
+
generateSasUrl(): string;
|
|
929
|
+
getAccessPolicy(): Promise<QueueGetAccessPolicyResponse>;
|
|
930
|
+
getProperties(): Promise<QueueGetPropertiesResponse>;
|
|
931
|
+
getServiceProperties(): Promise<QueueServiceProperties>;
|
|
932
|
+
listQueues(): AsyncIterableIterator<QueueItem>;
|
|
933
|
+
peekMessages(_options?: QueuePeekMessagesOptions): Promise<QueuePeekMessagesResponse>;
|
|
934
|
+
receiveMessages(_options?: QueueReceiveMessageOptions): Promise<QueueReceiveMessageResponse>;
|
|
935
|
+
sendMessage(messageText: string, _options?: QueueSendMessageOptions): Promise<QueueSendMessageResponse>;
|
|
936
|
+
setAccessPolicy(_identifiers?: SignedIdentifier[]): Promise<QueueSetAccessPolicyResponse>;
|
|
937
|
+
setMetadata(): Promise<QueueSetMetadataResponse>;
|
|
938
|
+
updateMessage(): Promise<QueueUpdateMessageResponse>;
|
|
939
|
+
}
|
|
848
940
|
//#endregion
|
|
849
|
-
//#region src/models/MockTableClient.d.ts
|
|
941
|
+
//#region src/models/table/MockTableClient.d.ts
|
|
850
942
|
/**
|
|
851
943
|
* An in-memory mock of the Azure TableClient.
|
|
852
944
|
* It uses a Map to simulate table storage and correctly implements the TableClient interface.
|
|
@@ -878,10 +970,10 @@ declare class MockTableClient implements Except<TableClient, "pipeline"> {
|
|
|
878
970
|
private withMetadata;
|
|
879
971
|
}
|
|
880
972
|
//#endregion
|
|
881
|
-
//#region src/services/
|
|
973
|
+
//#region src/services/container/bodyToBuffer.d.ts
|
|
882
974
|
declare const bodyToBuffer: (body: HttpRequestBody) => Promise<Buffer>;
|
|
883
975
|
//#endregion
|
|
884
|
-
//#region src/services/
|
|
976
|
+
//#region src/services/container/getAzureErrorXml.d.ts
|
|
885
977
|
/**
|
|
886
978
|
* Generates a standard Azure Storage error XML response body.
|
|
887
979
|
* @param errorCode The official Azure error code (e.g., "BlobNotFound").
|
|
@@ -890,16 +982,16 @@ declare const bodyToBuffer: (body: HttpRequestBody) => Promise<Buffer>;
|
|
|
890
982
|
*/
|
|
891
983
|
declare const getAzureErrorXml: (errorCode: string, errorMessage: string) => string;
|
|
892
984
|
//#endregion
|
|
893
|
-
//#region src/services/
|
|
985
|
+
//#region src/services/container/getBlobItemXml.d.ts
|
|
894
986
|
declare const getBlobItemXml: ({
|
|
895
987
|
name,
|
|
896
988
|
properties
|
|
897
989
|
}: BlobItem) => string;
|
|
898
990
|
//#endregion
|
|
899
|
-
//#region src/services/
|
|
991
|
+
//#region src/services/container/getBlobPrefixXml.d.ts
|
|
900
992
|
declare const getBlobPrefixXml: (name: string) => string;
|
|
901
993
|
//#endregion
|
|
902
|
-
//#region src/services/
|
|
994
|
+
//#region src/services/container/getListBlobsXml.d.ts
|
|
903
995
|
/**
|
|
904
996
|
* Generates a standard Azure Storage list blobs XML response body.
|
|
905
997
|
* @param containerName The container name.
|
|
@@ -908,7 +1000,7 @@ declare const getBlobPrefixXml: (name: string) => string;
|
|
|
908
1000
|
*/
|
|
909
1001
|
declare const getListBlobsXml: (containerName: string, blobsXml: string) => string;
|
|
910
1002
|
//#endregion
|
|
911
|
-
//#region src/services/
|
|
1003
|
+
//#region src/services/container/isReadableStream.d.ts
|
|
912
1004
|
declare const isReadableStream: (value: unknown) => value is NodeJS.ReadableStream;
|
|
913
1005
|
//#endregion
|
|
914
1006
|
//#region ../../node_modules/.pnpm/@azure+abort-controller@2.1.2/node_modules/@azure/abort-controller/dist/esm/AbortSignalLike.d.ts
|
|
@@ -1532,7 +1624,7 @@ type TransferProgressEvent = {
|
|
|
1532
1624
|
loadedBytes: number;
|
|
1533
1625
|
};
|
|
1534
1626
|
//#endregion
|
|
1535
|
-
//#region src/services/
|
|
1627
|
+
//#region src/services/container/toWebResourceLike.d.ts
|
|
1536
1628
|
declare const toWebResourceLike: (request: PipelineRequest) => WebResourceLike;
|
|
1537
1629
|
//#endregion
|
|
1538
1630
|
//#region src/services/table/applyTableFilter.d.ts
|
|
@@ -1547,4 +1639,4 @@ declare const createTableFilterPredicate: <T extends Record<string, unknown>>(fi
|
|
|
1547
1639
|
//#region src/services/table/isTableNullClause.d.ts
|
|
1548
1640
|
declare const isTableNullClause: (clause: Clause) => boolean;
|
|
1549
1641
|
//#endregion
|
|
1550
|
-
export { BlobHierarchyItem, MockBlobBatchClient, MockBlobClient, MockBlockBlobClient, MockContainerClient, MockContainerDatabase, MockRestError, MockTableClient, MockTableDatabase, PageSettings, PagedAsyncIterableIterator, applyTableFilter, bodyToBuffer, compare, createTableFilterPredicate, getAzureErrorXml, getBlobItemXml, getBlobPrefixXml, getListBlobsXml, isReadableStream, isTableNullClause, toWebResourceLike };
|
|
1642
|
+
export { BlobHierarchyItem, MockBlobBatchClient, MockBlobClient, MockBlockBlobClient, MockContainerClient, MockContainerDatabase, MockEventGridDatabase, MockEventGridPublisherClient, MockQueueClient, MockQueueDatabase, MockRestError, MockTableClient, MockTableDatabase, PageSettings, PagedAsyncIterableIterator, applyTableFilter, bodyToBuffer, compare, createTableFilterPredicate, getAzureErrorXml, getBlobItemXml, getBlobPrefixXml, getListBlobsXml, isReadableStream, isTableNullClause, toWebResourceLike };
|