azure-mock 2.14.0 → 2.15.1
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 +60 -53
- package/dist/index.js +69005 -1086
- package/package.json +11 -5
package/dist/index.d.ts
CHANGED
|
@@ -9,17 +9,6 @@ type BlobHierarchyItem = (BlobItem & {
|
|
|
9
9
|
});
|
|
10
10
|
//#endregion
|
|
11
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
12
|
|
|
24
13
|
//#endregion
|
|
25
14
|
//#region src/util/types/MapValue.d.ts
|
|
@@ -44,7 +33,7 @@ declare class MockBlobBatchClient implements BlobBatchClient {
|
|
|
44
33
|
getContainer(containerName: string): MapValue<typeof MockContainerDatabase>;
|
|
45
34
|
}
|
|
46
35
|
//#endregion
|
|
47
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
36
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/is-any.d.ts
|
|
48
37
|
/**
|
|
49
38
|
Returns a boolean for whether the given type is `any`.
|
|
50
39
|
|
|
@@ -75,7 +64,7 @@ const anyA = get(anyObject, 'a');
|
|
|
75
64
|
*/
|
|
76
65
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
77
66
|
//#endregion
|
|
78
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
67
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
79
68
|
/**
|
|
80
69
|
Returns a boolean for whether the given key is an optional key of type.
|
|
81
70
|
|
|
@@ -118,7 +107,7 @@ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
|
118
107
|
*/
|
|
119
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;
|
|
120
109
|
//#endregion
|
|
121
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
110
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/optional-keys-of.d.ts
|
|
122
111
|
/**
|
|
123
112
|
Extract all optional keys from the given type.
|
|
124
113
|
|
|
@@ -156,7 +145,7 @@ type OptionalKeysOf<Type extends object> = Type extends unknown // For distribut
|
|
|
156
145
|
? (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
146
|
: never;
|
|
158
147
|
//#endregion
|
|
159
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
148
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/required-keys-of.d.ts
|
|
160
149
|
/**
|
|
161
150
|
Extract all required keys from the given type.
|
|
162
151
|
|
|
@@ -184,7 +173,7 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
|
|
|
184
173
|
type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
|
|
185
174
|
? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
|
|
186
175
|
//#endregion
|
|
187
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
176
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/is-never.d.ts
|
|
188
177
|
/**
|
|
189
178
|
Returns a boolean for whether the given type is `never`.
|
|
190
179
|
|
|
@@ -228,7 +217,7 @@ endIfEqual('abc', '123');
|
|
|
228
217
|
*/
|
|
229
218
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
230
219
|
//#endregion
|
|
231
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
220
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/if.d.ts
|
|
232
221
|
/**
|
|
233
222
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
234
223
|
|
|
@@ -288,7 +277,7 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
288
277
|
*/
|
|
289
278
|
type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
|
|
290
279
|
//#endregion
|
|
291
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
280
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/is-equal.d.ts
|
|
292
281
|
/**
|
|
293
282
|
Returns a boolean for whether the two given types are equal.
|
|
294
283
|
|
|
@@ -317,7 +306,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
317
306
|
*/
|
|
318
307
|
type IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
319
308
|
//#endregion
|
|
320
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
309
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/simplify.d.ts
|
|
321
310
|
/**
|
|
322
311
|
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
312
|
|
|
@@ -377,7 +366,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
377
366
|
*/
|
|
378
367
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
379
368
|
//#endregion
|
|
380
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
369
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/omit-index-signature.d.ts
|
|
381
370
|
/**
|
|
382
371
|
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
383
372
|
|
|
@@ -470,7 +459,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
470
459
|
*/
|
|
471
460
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
472
461
|
//#endregion
|
|
473
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
462
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/pick-index-signature.d.ts
|
|
474
463
|
/**
|
|
475
464
|
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
476
465
|
|
|
@@ -518,7 +507,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
518
507
|
*/
|
|
519
508
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
520
509
|
//#endregion
|
|
521
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
510
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/merge.d.ts
|
|
522
511
|
// Merges two objects without worrying about index signatures.
|
|
523
512
|
type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
|
|
524
513
|
|
|
@@ -558,7 +547,7 @@ export type FooBar = Merge<Foo, Bar>;
|
|
|
558
547
|
*/
|
|
559
548
|
type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
560
549
|
//#endregion
|
|
561
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
550
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/internal/object.d.ts
|
|
562
551
|
/**
|
|
563
552
|
Merges user specified options with default options.
|
|
564
553
|
|
|
@@ -613,7 +602,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
613
602
|
*/
|
|
614
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>>>>;
|
|
615
604
|
//#endregion
|
|
616
|
-
//#region ../../node_modules/.pnpm/type-fest@5.0.
|
|
605
|
+
//#region ../../node_modules/.pnpm/type-fest@5.0.1/node_modules/type-fest/source/except.d.ts
|
|
617
606
|
/**
|
|
618
607
|
Filter out keys from an object.
|
|
619
608
|
|
|
@@ -892,10 +881,10 @@ declare class MockTableClient implements Except<TableClient, "pipeline"> {
|
|
|
892
881
|
private withMetadata;
|
|
893
882
|
}
|
|
894
883
|
//#endregion
|
|
895
|
-
//#region src/
|
|
884
|
+
//#region src/services/blob/bodyToBuffer.d.ts
|
|
896
885
|
declare const bodyToBuffer: (body: HttpRequestBody) => Promise<Buffer>;
|
|
897
886
|
//#endregion
|
|
898
|
-
//#region src/
|
|
887
|
+
//#region src/services/blob/getAzureErrorXml.d.ts
|
|
899
888
|
/**
|
|
900
889
|
* Generates a standard Azure Storage error XML response body.
|
|
901
890
|
* @param errorCode The official Azure error code (e.g., "BlobNotFound").
|
|
@@ -904,16 +893,16 @@ declare const bodyToBuffer: (body: HttpRequestBody) => Promise<Buffer>;
|
|
|
904
893
|
*/
|
|
905
894
|
declare const getAzureErrorXml: (errorCode: string, errorMessage: string) => string;
|
|
906
895
|
//#endregion
|
|
907
|
-
//#region src/
|
|
896
|
+
//#region src/services/blob/getBlobItemXml.d.ts
|
|
908
897
|
declare const getBlobItemXml: ({
|
|
909
898
|
name,
|
|
910
899
|
properties
|
|
911
900
|
}: BlobItem) => string;
|
|
912
901
|
//#endregion
|
|
913
|
-
//#region src/
|
|
902
|
+
//#region src/services/blob/getBlobPrefixXml.d.ts
|
|
914
903
|
declare const getBlobPrefixXml: (name: string) => string;
|
|
915
904
|
//#endregion
|
|
916
|
-
//#region src/
|
|
905
|
+
//#region src/services/blob/getListBlobsXml.d.ts
|
|
917
906
|
/**
|
|
918
907
|
* Generates a standard Azure Storage list blobs XML response body.
|
|
919
908
|
* @param containerName The container name.
|
|
@@ -922,7 +911,7 @@ declare const getBlobPrefixXml: (name: string) => string;
|
|
|
922
911
|
*/
|
|
923
912
|
declare const getListBlobsXml: (containerName: string, blobsXml: string) => string;
|
|
924
913
|
//#endregion
|
|
925
|
-
//#region src/
|
|
914
|
+
//#region src/services/blob/isReadableStream.d.ts
|
|
926
915
|
declare const isReadableStream: (value: unknown) => value is NodeJS.ReadableStream;
|
|
927
916
|
//#endregion
|
|
928
917
|
//#region ../../node_modules/.pnpm/@azure+abort-controller@2.1.2/node_modules/@azure/abort-controller/dist/esm/AbortSignalLike.d.ts
|
|
@@ -1546,37 +1535,55 @@ type TransferProgressEvent = {
|
|
|
1546
1535
|
loadedBytes: number;
|
|
1547
1536
|
};
|
|
1548
1537
|
//#endregion
|
|
1549
|
-
//#region src/
|
|
1538
|
+
//#region src/services/blob/toWebResourceLike.d.ts
|
|
1550
1539
|
declare const toWebResourceLike: (request: PipelineRequest) => WebResourceLike;
|
|
1551
1540
|
//#endregion
|
|
1552
|
-
//#region
|
|
1553
|
-
|
|
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 = {
|
|
1554
1562
|
key: string;
|
|
1555
1563
|
not?: boolean;
|
|
1564
|
+
} & ({
|
|
1556
1565
|
operator: BinaryOperator;
|
|
1557
|
-
value:
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1566
|
+
value: SerializableValue;
|
|
1567
|
+
} | {
|
|
1568
|
+
operator: Exclude<SearchOperator, SearchOperator.arrayContains>;
|
|
1569
|
+
value: SerializableValue;
|
|
1570
|
+
} | {
|
|
1571
|
+
operator: SearchOperator.arrayContains;
|
|
1572
|
+
value: SerializableValue[];
|
|
1573
|
+
});
|
|
1562
1574
|
//#endregion
|
|
1563
|
-
//#region src/
|
|
1564
|
-
declare const compare: (operator: BinaryOperator, leftHandSide: string, rightHandSide: string) => boolean;
|
|
1575
|
+
//#region src/models/azure/UnaryOperator.d.ts
|
|
1565
1576
|
//#endregion
|
|
1566
|
-
//#region src/
|
|
1567
|
-
declare const
|
|
1577
|
+
//#region src/services/table/applyTableFilter.d.ts
|
|
1578
|
+
declare const applyTableFilter: <T extends Record<string, unknown>>(entities: TableEntity<T>[], clauses: Clause[]) => TableEntity<T>[];
|
|
1568
1579
|
//#endregion
|
|
1569
|
-
//#region src/
|
|
1570
|
-
declare const
|
|
1580
|
+
//#region src/services/table/compare.d.ts
|
|
1581
|
+
declare const compare: <T>(operator: BinaryOperator, leftHandSide: T, rightHandSide: null | T) => boolean;
|
|
1571
1582
|
//#endregion
|
|
1572
|
-
//#region src/
|
|
1573
|
-
declare const
|
|
1574
|
-
not,
|
|
1575
|
-
operator,
|
|
1576
|
-
value
|
|
1577
|
-
}: Clause) => boolean;
|
|
1583
|
+
//#region src/services/table/createTableFilterPredicate.d.ts
|
|
1584
|
+
declare const createTableFilterPredicate: <T extends Record<string, unknown>>(filter: string) => ((entity: TableEntity<T>) => boolean);
|
|
1578
1585
|
//#endregion
|
|
1579
|
-
//#region src/
|
|
1580
|
-
declare const
|
|
1586
|
+
//#region src/services/table/isTableNullClause.d.ts
|
|
1587
|
+
declare const isTableNullClause: (clause: Clause) => boolean;
|
|
1581
1588
|
//#endregion
|
|
1582
|
-
export { BlobHierarchyItem,
|
|
1589
|
+
export { BlobHierarchyItem, MockBlobBatchClient, MockBlobClient, MockBlockBlobClient, MockContainerClient, MockContainerDatabase, MockRestError, MockTableClient, MockTableDatabase, PageSettings, PagedAsyncIterableIterator, applyTableFilter, bodyToBuffer, compare, createTableFilterPredicate, getAzureErrorXml, getBlobItemXml, getBlobPrefixXml, getListBlobsXml, isReadableStream, isTableNullClause, toWebResourceLike };
|