azure-mock 2.14.0 → 2.15.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 -48
- package/dist/index.js +5579 -146
- package/package.json +9 -5
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,31 @@ declare enum BinaryOperator {
|
|
|
19
19
|
ne = "ne",
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region src/models/azure/
|
|
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
|
|
23
47
|
|
|
24
48
|
//#endregion
|
|
25
49
|
//#region src/util/types/MapValue.d.ts
|
|
@@ -44,7 +68,7 @@ declare class MockBlobBatchClient implements BlobBatchClient {
|
|
|
44
68
|
getContainer(containerName: string): MapValue<typeof MockContainerDatabase>;
|
|
45
69
|
}
|
|
46
70
|
//#endregion
|
|
47
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
71
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/is-any.d.ts
|
|
48
72
|
/**
|
|
49
73
|
Returns a boolean for whether the given type is `any`.
|
|
50
74
|
|
|
@@ -75,7 +99,7 @@ const anyA = get(anyObject, 'a');
|
|
|
75
99
|
*/
|
|
76
100
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
77
101
|
//#endregion
|
|
78
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
102
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
79
103
|
/**
|
|
80
104
|
Returns a boolean for whether the given key is an optional key of type.
|
|
81
105
|
|
|
@@ -118,7 +142,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
118
142
|
*/
|
|
119
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;
|
|
120
144
|
//#endregion
|
|
121
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
145
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
122
146
|
/**
|
|
123
147
|
Extract all optional keys from the given type.
|
|
124
148
|
|
|
@@ -156,7 +180,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
156
180
|
? (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
181
|
: never;
|
|
158
182
|
//#endregion
|
|
159
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
183
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/required-keys-of.d.ts
|
|
160
184
|
/**
|
|
161
185
|
Extract all required keys from the given type.
|
|
162
186
|
|
|
@@ -184,7 +208,7 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
|
|
|
184
208
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
185
209
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
186
210
|
//#endregion
|
|
187
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
211
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/is-never.d.ts
|
|
188
212
|
/**
|
|
189
213
|
Returns a boolean for whether the given type is `never`.
|
|
190
214
|
|
|
@@ -228,7 +252,7 @@ endIfEqual('abc', '123');
|
|
|
228
252
|
*/
|
|
229
253
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
230
254
|
//#endregion
|
|
231
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
255
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/if.d.ts
|
|
232
256
|
/**
|
|
233
257
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
234
258
|
|
|
@@ -288,7 +312,7 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
288
312
|
*/
|
|
289
313
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
290
314
|
//#endregion
|
|
291
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
315
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/is-equal.d.ts
|
|
292
316
|
/**
|
|
293
317
|
Returns a boolean for whether the two given types are equal.
|
|
294
318
|
|
|
@@ -317,7 +341,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
317
341
|
*/
|
|
318
342
|
type IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
319
343
|
//#endregion
|
|
320
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
344
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/simplify.d.ts
|
|
321
345
|
/**
|
|
322
346
|
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.
|
|
323
347
|
|
|
@@ -377,7 +401,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
377
401
|
*/
|
|
378
402
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
379
403
|
//#endregion
|
|
380
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
404
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
381
405
|
/**
|
|
382
406
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
383
407
|
|
|
@@ -470,7 +494,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
470
494
|
*/
|
|
471
495
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
472
496
|
//#endregion
|
|
473
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
497
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
474
498
|
/**
|
|
475
499
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
476
500
|
|
|
@@ -518,7 +542,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
518
542
|
*/
|
|
519
543
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
520
544
|
//#endregion
|
|
521
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
545
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/merge.d.ts
|
|
522
546
|
// Merges two objects without worrying about index signatures.
|
|
523
547
|
type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
|
|
524
548
|
|
|
@@ -558,7 +582,7 @@ export type FooBar = Merge<Foo, Bar>;
|
|
|
558
582
|
*/
|
|
559
583
|
type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
560
584
|
//#endregion
|
|
561
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
585
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/internal/object.d.ts
|
|
562
586
|
/**
|
|
563
587
|
Merges user specified options with default options.
|
|
564
588
|
|
|
@@ -613,7 +637,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
613
637
|
*/
|
|
614
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>>>>;
|
|
615
639
|
//#endregion
|
|
616
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
640
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/except.d.ts
|
|
617
641
|
/**
|
|
618
642
|
Filter out keys from an object.
|
|
619
643
|
|
|
@@ -892,10 +916,10 @@ declare class MockTableClient implements Except<TableClient, "pipeline"> {
|
|
|
892
916
|
private withMetadata;
|
|
893
917
|
}
|
|
894
918
|
//#endregion
|
|
895
|
-
//#region src/
|
|
919
|
+
//#region src/services/blob/bodyToBuffer.d.ts
|
|
896
920
|
declare const bodyToBuffer: (body: HttpRequestBody) => Promise<Buffer>;
|
|
897
921
|
//#endregion
|
|
898
|
-
//#region src/
|
|
922
|
+
//#region src/services/blob/getAzureErrorXml.d.ts
|
|
899
923
|
/**
|
|
900
924
|
* Generates a standard Azure Storage error XML response body.
|
|
901
925
|
* @param errorCode The official Azure error code (e.g., "BlobNotFound").
|
|
@@ -904,16 +928,16 @@ declare const bodyToBuffer: (body: HttpRequestBody) => Promise<Buffer>;
|
|
|
904
928
|
*/
|
|
905
929
|
declare const getAzureErrorXml: (errorCode: string, errorMessage: string) => string;
|
|
906
930
|
//#endregion
|
|
907
|
-
//#region src/
|
|
931
|
+
//#region src/services/blob/getBlobItemXml.d.ts
|
|
908
932
|
declare const getBlobItemXml: ({
|
|
909
933
|
name,
|
|
910
934
|
properties
|
|
911
935
|
}: BlobItem) => string;
|
|
912
936
|
//#endregion
|
|
913
|
-
//#region src/
|
|
937
|
+
//#region src/services/blob/getBlobPrefixXml.d.ts
|
|
914
938
|
declare const getBlobPrefixXml: (name: string) => string;
|
|
915
939
|
//#endregion
|
|
916
|
-
//#region src/
|
|
940
|
+
//#region src/services/blob/getListBlobsXml.d.ts
|
|
917
941
|
/**
|
|
918
942
|
* Generates a standard Azure Storage list blobs XML response body.
|
|
919
943
|
* @param containerName The container name.
|
|
@@ -922,7 +946,7 @@ declare const getBlobPrefixXml: (name: string) => string;
|
|
|
922
946
|
*/
|
|
923
947
|
declare const getListBlobsXml: (containerName: string, blobsXml: string) => string;
|
|
924
948
|
//#endregion
|
|
925
|
-
//#region src/
|
|
949
|
+
//#region src/services/blob/isReadableStream.d.ts
|
|
926
950
|
declare const isReadableStream: (value: unknown) => value is NodeJS.ReadableStream;
|
|
927
951
|
//#endregion
|
|
928
952
|
//#region ../../node_modules/.pnpm/@azure+abort-controller@2.1.2/node_modules/@azure/abort-controller/dist/esm/AbortSignalLike.d.ts
|
|
@@ -1546,37 +1570,19 @@ type TransferProgressEvent = {
|
|
|
1546
1570
|
loadedBytes: number;
|
|
1547
1571
|
};
|
|
1548
1572
|
//#endregion
|
|
1549
|
-
//#region src/
|
|
1573
|
+
//#region src/services/blob/toWebResourceLike.d.ts
|
|
1550
1574
|
declare const toWebResourceLike: (request: PipelineRequest) => WebResourceLike;
|
|
1551
1575
|
//#endregion
|
|
1552
|
-
//#region src/
|
|
1553
|
-
|
|
1554
|
-
key: string;
|
|
1555
|
-
not?: boolean;
|
|
1556
|
-
operator: BinaryOperator;
|
|
1557
|
-
value: string;
|
|
1558
|
-
}
|
|
1559
|
-
//#endregion
|
|
1560
|
-
//#region src/util/tableFilter/applyTableFilter.d.ts
|
|
1561
|
-
declare const applyTableFilter: <T extends object>(entities: TableEntity<T>[], filter: string) => TableEntity<T>[];
|
|
1562
|
-
//#endregion
|
|
1563
|
-
//#region src/util/tableFilter/compare.d.ts
|
|
1564
|
-
declare const compare: (operator: BinaryOperator, leftHandSide: string, rightHandSide: string) => boolean;
|
|
1565
|
-
//#endregion
|
|
1566
|
-
//#region src/util/tableFilter/constants.d.ts
|
|
1567
|
-
declare const CLAUSE_REGEX: RegExp;
|
|
1576
|
+
//#region src/services/table/applyTableFilter.d.ts
|
|
1577
|
+
declare const applyTableFilter: <T extends Record<string, unknown>>(entities: TableEntity<T>[], clauses: Clause[]) => TableEntity<T>[];
|
|
1568
1578
|
//#endregion
|
|
1569
|
-
//#region src/
|
|
1570
|
-
declare const
|
|
1579
|
+
//#region src/services/table/compare.d.ts
|
|
1580
|
+
declare const compare: <T>(operator: BinaryOperator, leftHandSide: T, rightHandSide: null | T) => boolean;
|
|
1571
1581
|
//#endregion
|
|
1572
|
-
//#region src/
|
|
1573
|
-
declare const
|
|
1574
|
-
not,
|
|
1575
|
-
operator,
|
|
1576
|
-
value
|
|
1577
|
-
}: Clause) => boolean;
|
|
1582
|
+
//#region src/services/table/createTableFilterPredicate.d.ts
|
|
1583
|
+
declare const createTableFilterPredicate: <T extends Record<string, unknown>>(filter: string) => ((entity: TableEntity<T>) => boolean);
|
|
1578
1584
|
//#endregion
|
|
1579
|
-
//#region src/
|
|
1580
|
-
declare const
|
|
1585
|
+
//#region src/services/table/isTableNullClause.d.ts
|
|
1586
|
+
declare const isTableNullClause: (clause: Clause) => boolean;
|
|
1581
1587
|
//#endregion
|
|
1582
|
-
export { BlobHierarchyItem,
|
|
1588
|
+
export { BlobHierarchyItem, MockBlobBatchClient, MockBlobClient, MockBlockBlobClient, MockContainerClient, MockContainerDatabase, MockRestError, MockTableClient, MockTableDatabase, PageSettings, PagedAsyncIterableIterator, applyTableFilter, bodyToBuffer, compare, createTableFilterPredicate, getAzureErrorXml, getBlobItemXml, getBlobPrefixXml, getListBlobsXml, isReadableStream, isTableNullClause, toWebResourceLike };
|