azure-mock 2.7.0 → 2.8.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 CHANGED
@@ -1,7 +1,6 @@
1
- import { AnonymousCredential, AppendBlobClient, BlobAbortCopyFromURLResponse, BlobBatchClient, BlobBeginCopyFromURLResponse, BlobClient, BlobCopyFromURLResponse, BlobCreateSnapshotResponse, BlobDeleteIfExistsResponse, BlobDeleteImmutabilityPolicyResponse, 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 } from "@azure/storage-blob";
1
+ 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
+ import { MapValue } from "type-fest/source/entry";
2
3
  import { CreateTableEntityResponse, GetAccessPolicyResponse, GetTableEntityResponse, TableClient, TableDeleteEntityHeaders, TableEntity, TableEntityResult, TableEntityResultPage, TableMergeEntityHeaders, TableSetAccessPolicyHeaders, TableTransactionResponse, UpdateMode } from "@azure/data-tables";
3
- import { WebResourceLike } from "@azure/core-http-compat";
4
- import { PipelineRequest } from "@azure/core-rest-pipeline";
5
4
 
6
5
  //#region src/models/BlobHierarchyItem.d.ts
7
6
  type BlobHierarchyItem = (BlobItem & {
@@ -10,38 +9,23 @@ type BlobHierarchyItem = (BlobItem & {
10
9
  kind: "prefix";
11
10
  });
12
11
  //#endregion
13
- //#region src/models/PageSettings.d.ts
14
- /**
15
- * An interface that tracks the settings for paged iteration
16
- */
17
- interface PageSettings {
18
- /**
19
- * The token that keeps track of where to continue the iterator
20
- */
21
- continuationToken?: string;
22
- /**
23
- * The size of the page during paged iteration
24
- */
25
- maxPageSize?: number;
26
- }
12
+ //#region src/store/MockContainerDatabase.d.ts
13
+ // Map<container, Map<name, blob>>
14
+ declare const MockContainerDatabase: Map<string, Map<string, Buffer>>;
27
15
  //#endregion
28
- //#region src/models/PagedAsyncIterableIterator.d.ts
29
- /**
30
- * An interface that allows async iterable iteration both to completion and by page.
31
- */
32
- interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
33
- /**
34
- * The connection to the async iterator, part of the iteration protocol
35
- */
36
- [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
37
- /**
38
- * Return an AsyncIterableIterator that works a page at a time
39
- */
40
- byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
16
+ //#region src/models/MockBlobBatchClient.d.ts
17
+ declare class MockBlobBatchClient implements BlobBatchClient {
18
+ url: string;
19
+ constructor(url: string);
41
20
  /**
42
- * The next method, part of the iteration protocol
21
+ * Simulates the deletion of multiple blobs in a single batch request.
22
+ * It iterates through the requested deletions, removes existing blobs from the
23
+ * underlying MockContainerDatabase, and builds a response object that reports
24
+ * which deletions succeeded and which failed (e.g. for blobs that didn't exist).
43
25
  */
44
- next(): Promise<IteratorResult<TElement>>;
26
+ // @ts-expect-error We will only implement urls for deleteBlobs and ignore overloads for now
27
+ deleteBlobs(urls: string[], credential: AnonymousCredential | StorageSharedKeyCredential, _options?: BlobDeleteOptions): Promise<BlobBatchDeleteBlobsResponse>;
28
+ getContainer(containerName: string): MapValue<typeof MockContainerDatabase>;
45
29
  }
46
30
  //#endregion
47
31
  //#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/observable-like.d.ts
@@ -677,6 +661,97 @@ type PostPayload = Except<UserData, 'email'>;
677
661
  type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
678
662
  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>> : {});
679
663
  //#endregion
664
+ //#region src/models/MockBlobClient.d.ts
665
+ declare class MockBlobClient implements Except<BlobClient, "accountName"> {
666
+ connectionString: string;
667
+ containerName: string;
668
+ credential: AnonymousCredential;
669
+ name: string;
670
+ url: string;
671
+ get container(): MapValue<typeof MockContainerDatabase>;
672
+ constructor(connectionString: string, containerName: string, blobName: string);
673
+ abortCopyFromURL(): Promise<BlobAbortCopyFromURLResponse>;
674
+ beginCopyFromURL(): Promise<PollerLikeWithCancellation<PollOperationState<BlobBeginCopyFromURLResponse>, BlobBeginCopyFromURLResponse>>;
675
+ createSnapshot(): Promise<BlobCreateSnapshotResponse>;
676
+ delete(): Promise<BlobDeleteResponse>;
677
+ deleteIfExists(): Promise<BlobDeleteIfExistsResponse>;
678
+ deleteImmutabilityPolicy(): Promise<BlobDeleteImmutabilityPolicyResponse>;
679
+ download(): Promise<BlobDownloadResponseParsed>;
680
+ downloadToBuffer(): Promise<Buffer>;
681
+ downloadToFile(): Promise<BlobDownloadResponseParsed>;
682
+ exists(): Promise<boolean>;
683
+ generateSasStringToSign(): string;
684
+ generateSasUrl(): Promise<string>;
685
+ generateUserDelegationSasStringToSign(): string;
686
+ generateUserDelegationSasUrl(): Promise<string>;
687
+ getAccountInfo(): Promise<BlobGetAccountInfoResponse>;
688
+ getAppendBlobClient(): AppendBlobClient;
689
+ getBlobLeaseClient(): BlobLeaseClient;
690
+ getBlockBlobClient(): BlockBlobClient;
691
+ getPageBlobClient(): PageBlobClient;
692
+ getProperties(): Promise<BlobGetPropertiesResponse>;
693
+ getTags(): Promise<BlobGetTagsResponse>;
694
+ setAccessTier(): Promise<BlobSetTierResponse>;
695
+ setHTTPHeaders(): Promise<BlobSetHTTPHeadersResponse>;
696
+ setImmutabilityPolicy(): Promise<BlobSetImmutabilityPolicyResponse>;
697
+ setLegalHold(): Promise<BlobSetLegalHoldResponse>;
698
+ setMetadata(): Promise<BlobSetMetadataResponse>;
699
+ setTags(): Promise<BlobSetTagsResponse>;
700
+ syncCopyFromURL(): Promise<BlobCopyFromURLResponse>;
701
+ undelete(): Promise<BlobUndeleteResponse>;
702
+ withSnapshot(): BlockBlobClient;
703
+ withVersion(): BlobClient;
704
+ }
705
+ //#endregion
706
+ //#region src/models/MockBlockBlobClient.d.ts
707
+ declare class MockBlockBlobClient extends MockBlobClient implements Except<BlockBlobClient, "accountName"> {
708
+ commitBlockList(): Promise<BlockBlobCommitBlockListResponse>;
709
+ getBlockList(): Promise<BlockBlobGetBlockListResponse>;
710
+ query(): Promise<BlobDownloadResponseModel>;
711
+ stageBlock(): Promise<BlockBlobStageBlockResponse>;
712
+ stageBlockFromURL(): Promise<BlockBlobStageBlockFromURLResponse>;
713
+ syncUploadFromURL(): Promise<BlockBlobPutBlobFromUrlResponse>;
714
+ upload(body: HttpRequestBody, _contentLength: number): Promise<BlockBlobUploadResponse>;
715
+ uploadBrowserData(): Promise<BlobUploadCommonResponse>;
716
+ uploadData(): Promise<BlobUploadCommonResponse>;
717
+ uploadFile(): Promise<BlobUploadCommonResponse>;
718
+ uploadStream(): Promise<BlobUploadCommonResponse>;
719
+ }
720
+ //#endregion
721
+ //#region src/models/PageSettings.d.ts
722
+ /**
723
+ * An interface that tracks the settings for paged iteration
724
+ */
725
+ interface PageSettings {
726
+ /**
727
+ * The token that keeps track of where to continue the iterator
728
+ */
729
+ continuationToken?: string;
730
+ /**
731
+ * The size of the page during paged iteration
732
+ */
733
+ maxPageSize?: number;
734
+ }
735
+ //#endregion
736
+ //#region src/models/PagedAsyncIterableIterator.d.ts
737
+ /**
738
+ * An interface that allows async iterable iteration both to completion and by page.
739
+ */
740
+ interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
741
+ /**
742
+ * The connection to the async iterator, part of the iteration protocol
743
+ */
744
+ [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
745
+ /**
746
+ * Return an AsyncIterableIterator that works a page at a time
747
+ */
748
+ byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
749
+ /**
750
+ * The next method, part of the iteration protocol
751
+ */
752
+ next(): Promise<IteratorResult<TElement>>;
753
+ }
754
+ //#endregion
680
755
  //#region src/models/MockContainerClient.d.ts
681
756
  /**
682
757
  * An in-memory mock of the Azure ContainerClient.
@@ -689,11 +764,12 @@ type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Requ
689
764
  * const content = await blockBlobClient.downloadToBuffer();
690
765
  */
691
766
  declare class MockContainerClient implements Except<ContainerClient, "accountName"> {
692
- blobs: Map<string, Buffer>;
767
+ connectionString: string;
693
768
  containerName: string;
694
769
  credential: AnonymousCredential;
695
770
  url: string;
696
- constructor(_connectionString: string, containerName: string);
771
+ get container(): MapValue<typeof MockContainerDatabase>;
772
+ constructor(connectionString: string, containerName: string);
697
773
  create(): Promise<ContainerCreateResponse>;
698
774
  createIfNotExists(): Promise<ContainerCreateIfNotExistsResponse>;
699
775
  delete(): Promise<ContainerDeleteResponse>;
@@ -709,7 +785,7 @@ declare class MockContainerClient implements Except<ContainerClient, "accountNam
709
785
  getAccountInfo(): Promise<ContainerGetAccountInfoResponse>;
710
786
  getAppendBlobClient(): AppendBlobClient;
711
787
  getBlobBatchClient(): BlobBatchClient;
712
- getBlobClient(): BlobClient;
788
+ getBlobClient(blobName: string): BlobClient;
713
789
  getBlobLeaseClient(): BlobLeaseClient;
714
790
  getBlockBlobClient(blobName: string): BlockBlobClient;
715
791
  getPageBlobClient(): PageBlobClient;
@@ -726,58 +802,6 @@ declare class MockContainerClient implements Except<ContainerClient, "accountNam
726
802
  private getBlobItemIterator;
727
803
  }
728
804
  //#endregion
729
- //#region src/models/MockBlockBlobClient.d.ts
730
- declare class MockBlockBlobClient implements Except<BlockBlobClient, "accountName"> {
731
- containerClient: MockContainerClient;
732
- credential: AnonymousCredential;
733
- name: string;
734
- url: string;
735
- get containerName(): string;
736
- constructor(_connectionString: string, containerClient: MockContainerClient, blobName: string);
737
- abortCopyFromURL(): Promise<BlobAbortCopyFromURLResponse>;
738
- beginCopyFromURL(): Promise<PollerLikeWithCancellation<PollOperationState<BlobBeginCopyFromURLResponse>, BlobBeginCopyFromURLResponse>>;
739
- commitBlockList(): Promise<BlockBlobCommitBlockListResponse>;
740
- createSnapshot(): Promise<BlobCreateSnapshotResponse>;
741
- delete(): Promise<BlobDeleteResponse>;
742
- deleteIfExists(): Promise<BlobDeleteIfExistsResponse>;
743
- deleteImmutabilityPolicy(): Promise<BlobDeleteImmutabilityPolicyResponse>;
744
- download(): Promise<BlobDownloadResponseParsed>;
745
- downloadToBuffer(): Promise<Buffer>;
746
- downloadToFile(): Promise<BlobDownloadResponseParsed>;
747
- exists(): Promise<boolean>;
748
- generateSasStringToSign(): string;
749
- generateSasUrl(): Promise<string>;
750
- generateUserDelegationSasStringToSign(): string;
751
- generateUserDelegationSasUrl(): Promise<string>;
752
- getAccountInfo(): Promise<BlobGetAccountInfoResponse>;
753
- getAppendBlobClient(): AppendBlobClient;
754
- getBlobLeaseClient(): BlobLeaseClient;
755
- getBlockBlobClient(): BlockBlobClient;
756
- getBlockList(): Promise<BlockBlobGetBlockListResponse>;
757
- getPageBlobClient(): PageBlobClient;
758
- getProperties(): Promise<BlobGetPropertiesResponse>;
759
- getTags(): Promise<BlobGetTagsResponse>;
760
- query(): Promise<BlobDownloadResponseModel>;
761
- setAccessTier(): Promise<BlobSetTierResponse>;
762
- setHTTPHeaders(): Promise<BlobSetHTTPHeadersResponse>;
763
- setImmutabilityPolicy(): Promise<BlobSetImmutabilityPolicyResponse>;
764
- setLegalHold(): Promise<BlobSetLegalHoldResponse>;
765
- setMetadata(): Promise<BlobSetMetadataResponse>;
766
- setTags(): Promise<BlobSetTagsResponse>;
767
- stageBlock(): Promise<BlockBlobStageBlockResponse>;
768
- stageBlockFromURL(): Promise<BlockBlobStageBlockFromURLResponse>;
769
- syncCopyFromURL(): Promise<BlobCopyFromURLResponse>;
770
- syncUploadFromURL(): Promise<BlockBlobPutBlobFromUrlResponse>;
771
- undelete(): Promise<BlobUndeleteResponse>;
772
- upload(body: HttpRequestBody, _contentLength: number): Promise<BlockBlobUploadResponse>;
773
- uploadBrowserData(): Promise<BlobUploadCommonResponse>;
774
- uploadData(): Promise<BlobUploadCommonResponse>;
775
- uploadFile(): Promise<BlobUploadCommonResponse>;
776
- uploadStream(): Promise<BlobUploadCommonResponse>;
777
- withSnapshot(): BlockBlobClient;
778
- withVersion(): BlobClient;
779
- }
780
- //#endregion
781
805
  //#region src/models/MockRestError.d.ts
782
806
  // A mock error class that mimics the structure of Azure's RestError
783
807
  // This allows you to test error handling more realistically.
@@ -786,6 +810,10 @@ declare class MockRestError extends Error {
786
810
  constructor(message: string, statusCode: number);
787
811
  }
788
812
  //#endregion
813
+ //#region src/store/MockTableDatabase.d.ts
814
+ // Record<table, Map<compositeKey, entity>>
815
+ declare const MockTableDatabase: Map<string, Map<string, TableEntity>>;
816
+ //#endregion
789
817
  //#region src/models/MockTableClient.d.ts
790
818
  /**
791
819
  * An in-memory mock of the Azure TableClient.
@@ -797,9 +825,9 @@ declare class MockRestError extends Error {
797
825
  * const entity = await mockTableClient.getEntity("partitionKey", "rowKey");
798
826
  */
799
827
  declare class MockTableClient implements Except<TableClient, "pipeline"> {
800
- entities: Map<string, TableEntity>;
801
828
  tableName: string;
802
829
  url: string;
830
+ get table(): MapValue<typeof MockTableDatabase>;
803
831
  constructor(_url: string, tableName: string);
804
832
  createEntity<T extends object>(entity: TableEntity<T>): Promise<CreateTableEntityResponse>;
805
833
  createTable(): Promise<void>;
@@ -821,6 +849,15 @@ declare class MockTableClient implements Except<TableClient, "pipeline"> {
821
849
  //#region src/util/bodyToBuffer.d.ts
822
850
  declare const bodyToBuffer: (body: HttpRequestBody) => Promise<Buffer>;
823
851
  //#endregion
852
+ //#region src/util/getAzureErrorXml.d.ts
853
+ /**
854
+ * Generates a standard Azure Storage error XML response body.
855
+ * @param errorCode The official Azure error code (e.g., "BlobNotFound").
856
+ * @param errorMessage The user-friendly error message.
857
+ * @returns A formatted XML string.
858
+ */
859
+ declare const getAzureErrorXml: (errorCode: string, errorMessage: string) => string;
860
+ //#endregion
824
861
  //#region src/util/getBlobItemXml.d.ts
825
862
  declare const getBlobItemXml: ({
826
863
  name,
@@ -833,7 +870,655 @@ declare const getBlobPrefixXml: (name: string) => string;
833
870
  //#region src/util/isReadableStream.d.ts
834
871
  declare const isReadableStream: (value: unknown) => value is NodeJS.ReadableStream;
835
872
  //#endregion
873
+ //#region ../../node_modules/.pnpm/@azure+abort-controller@2.1.2/node_modules/@azure/abort-controller/dist/esm/AbortSignalLike.d.ts
874
+ /**
875
+ * Allows the request to be aborted upon firing of the "abort" event.
876
+ * Compatible with the browser built-in AbortSignal and common polyfills.
877
+ */
878
+ interface AbortSignalLike {
879
+ /**
880
+ * Indicates if the signal has already been aborted.
881
+ */
882
+ readonly aborted: boolean;
883
+ /**
884
+ * Add new "abort" event listener, only support "abort" event.
885
+ */
886
+ addEventListener(type: "abort", listener: (this: AbortSignalLike, ev: any) => any, options?: any): void;
887
+ /**
888
+ * Remove "abort" event listener, only support "abort" event.
889
+ */
890
+ removeEventListener(type: "abort", listener: (this: AbortSignalLike, ev: any) => any, options?: any): void;
891
+ }
892
+ //# sourceMappingURL=AbortSignalLike.d.ts.map
893
+ //#endregion
894
+ //#region ../../node_modules/.pnpm/@azure+abort-controller@2.1.2/node_modules/@azure/abort-controller/dist/esm/index.d.ts
895
+ declare global {
896
+ interface Event {}
897
+ }
898
+ //#endregion
899
+ //#region ../../node_modules/.pnpm/@azure+core-util@1.12.0/node_modules/@azure/core-util/dist/esm/index.d.ts
900
+ /**
901
+ * Supported HTTP methods to use when making requests.
902
+ *
903
+ * @public
904
+ */
905
+ type HttpMethods = "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "TRACE";
906
+ /**
907
+ * A generic shape for a plain JS object.
908
+ */
909
+
910
+ //#endregion
911
+ //#region ../../node_modules/.pnpm/@azure+core-tracing@1.2.0/node_modules/@azure/core-tracing/dist/esm/interfaces.d.ts
912
+ /** An immutable context bag of tracing values for the current operation. */
913
+ interface TracingContext {
914
+ /**
915
+ * Sets a given object on a context.
916
+ * @param key - The key of the given context value.
917
+ * @param value - The value to set on the context.
918
+ *
919
+ * @returns - A new context with the given value set.
920
+ */
921
+ setValue(key: symbol, value: unknown): TracingContext;
922
+ /**
923
+ * Gets an object from the context if it exists.
924
+ * @param key - The key of the given context value.
925
+ *
926
+ * @returns - The value of the given context value if it exists, otherwise `undefined`.
927
+ */
928
+ getValue(key: symbol): unknown;
929
+ /**
930
+ * Deletes an object from the context if it exists.
931
+ * @param key - The key of the given context value to delete.
932
+ */
933
+ deleteValue(key: symbol): TracingContext;
934
+ }
935
+ /**
936
+ * Tracing options to set on an operation.
937
+ */
938
+ interface OperationTracingOptions {
939
+ /** The context to use for created Tracing Spans. */
940
+ tracingContext?: TracingContext;
941
+ }
942
+ /**
943
+ * A utility type for when we know a TracingContext has been set
944
+ * as part of an operation's options.
945
+ */
946
+ //#endregion
947
+ //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.21.0/node_modules/@azure/core-rest-pipeline/dist/esm/interfaces.d.ts
948
+ /**
949
+ * A HttpHeaders collection represented as a simple JSON object.
950
+ */
951
+ type RawHttpHeaders$1 = {
952
+ [headerName: string]: string;
953
+ };
954
+ /**
955
+ * A HttpHeaders collection for input, represented as a simple JSON object.
956
+ */
957
+
958
+ /**
959
+ * Represents a set of HTTP headers on a request/response.
960
+ * Header names are treated as case insensitive.
961
+ */
962
+ interface HttpHeaders extends Iterable<[string, string]> {
963
+ /**
964
+ * Returns the value of a specific header or undefined if not set.
965
+ * @param name - The name of the header to retrieve.
966
+ */
967
+ get(name: string): string | undefined;
968
+ /**
969
+ * Returns true if the specified header exists.
970
+ * @param name - The name of the header to check.
971
+ */
972
+ has(name: string): boolean;
973
+ /**
974
+ * Sets a specific header with a given value.
975
+ * @param name - The name of the header to set.
976
+ * @param value - The value to use for the header.
977
+ */
978
+ set(name: string, value: string | number | boolean): void;
979
+ /**
980
+ * Removes a specific header from the collection.
981
+ * @param name - The name of the header to delete.
982
+ */
983
+ delete(name: string): void;
984
+ /**
985
+ * Accesses a raw JS object that acts as a simple map
986
+ * of header names to values.
987
+ */
988
+ toJSON(options?: {
989
+ preserveCase?: boolean;
990
+ }): RawHttpHeaders$1;
991
+ }
992
+ /**
993
+ * A part of the request body in a multipart request.
994
+ */
995
+ interface BodyPart {
996
+ /**
997
+ * The headers for this part of the multipart request.
998
+ */
999
+ headers: HttpHeaders;
1000
+ /**
1001
+ * The body of this part of the multipart request.
1002
+ */
1003
+ body: ((() => ReadableStream<Uint8Array>) | (() => NodeJS.ReadableStream)) | ReadableStream<Uint8Array> | NodeJS.ReadableStream | Uint8Array | Blob;
1004
+ }
1005
+ /**
1006
+ * A request body consisting of multiple parts.
1007
+ */
1008
+ interface MultipartRequestBody {
1009
+ /**
1010
+ * The parts of the request body.
1011
+ */
1012
+ parts: BodyPart[];
1013
+ /**
1014
+ * The boundary separating each part of the request body.
1015
+ * If not specified, a random boundary will be generated.
1016
+ *
1017
+ * When specified, '--' will be prepended to the boundary in the request to ensure the boundary follows the specification.
1018
+ */
1019
+ boundary?: string;
1020
+ }
1021
+ /**
1022
+ * Types of bodies supported on the request.
1023
+ * NodeJS.ReadableStream and () =\> NodeJS.ReadableStream is Node only.
1024
+ * Blob, ReadableStream<Uint8Array>, and () =\> ReadableStream<Uint8Array> are browser only.
1025
+ */
1026
+ type RequestBodyType = NodeJS.ReadableStream | (() => NodeJS.ReadableStream) | ReadableStream<Uint8Array> | (() => ReadableStream<Uint8Array>) | Blob | ArrayBuffer | ArrayBufferView | FormData | string | null;
1027
+ /**
1028
+ * An interface compatible with NodeJS's `http.Agent`.
1029
+ * We want to avoid publicly re-exporting the actual interface,
1030
+ * since it might vary across runtime versions.
1031
+ */
1032
+ interface Agent$1 {
1033
+ /**
1034
+ * Destroy any sockets that are currently in use by the agent.
1035
+ */
1036
+ destroy(): void;
1037
+ /**
1038
+ * For agents with keepAlive enabled, this sets the maximum number of sockets that will be left open in the free state.
1039
+ */
1040
+ maxFreeSockets: number;
1041
+ /**
1042
+ * Determines how many concurrent sockets the agent can have open per origin.
1043
+ */
1044
+ maxSockets: number;
1045
+ /**
1046
+ * An object which contains queues of requests that have not yet been assigned to sockets.
1047
+ */
1048
+ requests: unknown;
1049
+ /**
1050
+ * An object which contains arrays of sockets currently in use by the agent.
1051
+ */
1052
+ sockets: unknown;
1053
+ }
1054
+ /**
1055
+ * Metadata about a request being made by the pipeline.
1056
+ */
1057
+ interface PipelineRequest {
1058
+ /**
1059
+ * The URL to make the request to.
1060
+ */
1061
+ url: string;
1062
+ /**
1063
+ * The HTTP method to use when making the request.
1064
+ */
1065
+ method: HttpMethods;
1066
+ /**
1067
+ * The HTTP headers to use when making the request.
1068
+ */
1069
+ headers: HttpHeaders;
1070
+ /**
1071
+ * The number of milliseconds a request can take before automatically being terminated.
1072
+ * If the request is terminated, an `AbortError` is thrown.
1073
+ * Defaults to 0, which disables the timeout.
1074
+ */
1075
+ timeout: number;
1076
+ /**
1077
+ * Indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests.
1078
+ * Defaults to false.
1079
+ */
1080
+ withCredentials: boolean;
1081
+ /**
1082
+ * A unique identifier for the request. Used for logging and tracing.
1083
+ */
1084
+ requestId: string;
1085
+ /**
1086
+ * The HTTP body content (if any)
1087
+ */
1088
+ body?: RequestBodyType;
1089
+ /**
1090
+ * Body for a multipart request.
1091
+ */
1092
+ multipartBody?: MultipartRequestBody;
1093
+ /**
1094
+ * To simulate a browser form post
1095
+ */
1096
+ formData?: FormDataMap;
1097
+ /**
1098
+ * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.
1099
+ * When streamResponseStatusCodes contains the value Number.POSITIVE_INFINITY any status would be treated as a stream.
1100
+ */
1101
+ streamResponseStatusCodes?: Set<number>;
1102
+ /**
1103
+ * Proxy configuration.
1104
+ */
1105
+ proxySettings?: ProxySettings;
1106
+ /**
1107
+ * If the connection should not be reused.
1108
+ */
1109
+ disableKeepAlive?: boolean;
1110
+ /**
1111
+ * Used to abort the request later.
1112
+ */
1113
+ abortSignal?: AbortSignalLike;
1114
+ /**
1115
+ * Tracing options to use for any created Spans.
1116
+ */
1117
+ tracingOptions?: OperationTracingOptions;
1118
+ /**
1119
+ * Callback which fires upon upload progress.
1120
+ */
1121
+ onUploadProgress?: (progress: TransferProgressEvent$1) => void;
1122
+ /** Callback which fires upon download progress. */
1123
+ onDownloadProgress?: (progress: TransferProgressEvent$1) => void;
1124
+ /** Set to true if the request is sent over HTTP instead of HTTPS */
1125
+ allowInsecureConnection?: boolean;
1126
+ /**
1127
+ * NODEJS ONLY
1128
+ *
1129
+ * A Node-only option to provide a custom `http.Agent`/`https.Agent`.
1130
+ * Does nothing when running in the browser.
1131
+ */
1132
+ agent?: Agent$1;
1133
+ /**
1134
+ * BROWSER ONLY
1135
+ *
1136
+ * A browser only option to enable browser Streams. If this option is set and a response is a stream
1137
+ * the response will have a property `browserStream` instead of `blobBody` which will be undefined.
1138
+ *
1139
+ * Default value is false
1140
+ */
1141
+ enableBrowserStreams?: boolean;
1142
+ /** Settings for configuring TLS authentication */
1143
+ tlsSettings?: TlsSettings;
1144
+ /**
1145
+ * Additional options to set on the request. This provides a way to override
1146
+ * existing ones or provide request properties that are not declared.
1147
+ *
1148
+ * For possible valid properties, see
1149
+ * - NodeJS https.request options: https://nodejs.org/api/http.html#httprequestoptions-callback
1150
+ * - Browser RequestInit: https://developer.mozilla.org/en-US/docs/Web/API/RequestInit
1151
+ *
1152
+ * WARNING: Options specified here will override any properties of same names when request is sent by {@link HttpClient}.
1153
+ */
1154
+ requestOverrides?: Record<string, unknown>;
1155
+ }
1156
+ /**
1157
+ * Metadata about a response received by the pipeline.
1158
+ */
1159
+
1160
+ /**
1161
+ * Fired in response to upload or download progress.
1162
+ */
1163
+ type TransferProgressEvent$1 = {
1164
+ /**
1165
+ * The number of bytes loaded so far.
1166
+ */
1167
+ loadedBytes: number;
1168
+ };
1169
+ /**
1170
+ * Options to configure a proxy for outgoing requests (Node.js only).
1171
+ */
1172
+ interface ProxySettings {
1173
+ /**
1174
+ * The proxy's host address.
1175
+ * Must include the protocol (e.g., http:// or https://).
1176
+ */
1177
+ host: string;
1178
+ /**
1179
+ * The proxy host's port.
1180
+ */
1181
+ port: number;
1182
+ /**
1183
+ * The user name to authenticate with the proxy, if required.
1184
+ */
1185
+ username?: string;
1186
+ /**
1187
+ * The password to authenticate with the proxy, if required.
1188
+ */
1189
+ password?: string;
1190
+ }
1191
+ /**
1192
+ * Each form data entry can be a string, Blob, or a File. If you wish to pass a file with a name but do not have
1193
+ * access to the File class, you can use the createFile helper to create one.
1194
+ */
1195
+ type FormDataValue = string | Blob | File;
1196
+ /**
1197
+ * A simple object that provides form data, as if from a browser form.
1198
+ */
1199
+ type FormDataMap = {
1200
+ [key: string]: FormDataValue | FormDataValue[];
1201
+ };
1202
+ /**
1203
+ * Options that control how to retry failed requests.
1204
+ */
1205
+
1206
+ /**
1207
+ * Represents a certificate for TLS authentication.
1208
+ */
1209
+ interface TlsSettings {
1210
+ /**
1211
+ * Optionally override the trusted CA certificates. Default is to trust
1212
+ * the well-known CAs curated by Mozilla. Mozilla's CAs are completely
1213
+ * replaced when CAs are explicitly specified using this option.
1214
+ */
1215
+ ca?: string | Buffer | Array<string | Buffer> | undefined;
1216
+ /**
1217
+ * Cert chains in PEM format. One cert chain should be provided per
1218
+ * private key. Each cert chain should consist of the PEM formatted
1219
+ * certificate for a provided private key, followed by the PEM
1220
+ * formatted intermediate certificates (if any), in order, and not
1221
+ * including the root CA (the root CA must be pre-known to the peer,
1222
+ * see ca). When providing multiple cert chains, they do not have to
1223
+ * be in the same order as their private keys in key. If the
1224
+ * intermediate certificates are not provided, the peer will not be
1225
+ * able to validate the certificate, and the handshake will fail.
1226
+ */
1227
+ cert?: string | Buffer | Array<string | Buffer> | undefined;
1228
+ /**
1229
+ * Private keys in PEM format. PEM allows the option of private keys
1230
+ * being encrypted. Encrypted keys will be decrypted with
1231
+ * options.passphrase. Multiple keys using different algorithms can be
1232
+ * provided either as an array of unencrypted key strings or buffers,
1233
+ * or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.
1234
+ * The object form can only occur in an array.object.passphrase is optional.
1235
+ * Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.
1236
+ */
1237
+ key?: string | Buffer | Array<Buffer | KeyObject> | undefined;
1238
+ /**
1239
+ * Shared passphrase used for a single private key and/or a PFX.
1240
+ */
1241
+ passphrase?: string | undefined;
1242
+ /**
1243
+ * PFX or PKCS12 encoded private key and certificate chain. pfx is an
1244
+ * alternative to providing key and cert individually. PFX is usually
1245
+ * encrypted, if it is, passphrase will be used to decrypt it. Multiple
1246
+ * PFX can be provided either as an array of unencrypted PFX buffers,
1247
+ * or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.
1248
+ * The object form can only occur in an array.object.passphrase is optional.
1249
+ * Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.
1250
+ */
1251
+ pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;
1252
+ }
1253
+ /**
1254
+ * An interface compatible with NodeJS's `tls.KeyObject`.
1255
+ * We want to avoid publicly re-exporting the actual interface,
1256
+ * since it might vary across runtime versions.
1257
+ */
1258
+ interface KeyObject {
1259
+ /**
1260
+ * Private keys in PEM format.
1261
+ */
1262
+ pem: string | Buffer;
1263
+ /**
1264
+ * Optional passphrase.
1265
+ */
1266
+ passphrase?: string | undefined;
1267
+ }
1268
+ /**
1269
+ * An interface compatible with NodeJS's `tls.PxfObject`.
1270
+ * We want to avoid publicly re-exporting the actual interface,
1271
+ * since it might vary across runtime versions.
1272
+ */
1273
+ interface PxfObject {
1274
+ /**
1275
+ * PFX or PKCS12 encoded private key and certificate chain.
1276
+ */
1277
+ buf: string | Buffer;
1278
+ /**
1279
+ * Optional passphrase.
1280
+ */
1281
+ passphrase?: string | undefined;
1282
+ }
1283
+ //# sourceMappingURL=interfaces.d.ts.map
1284
+ //#endregion
1285
+ //#region ../../node_modules/.pnpm/@azure+core-rest-pipeline@1.21.0/node_modules/@azure/core-rest-pipeline/dist/esm/index.d.ts
1286
+ declare global {
1287
+ interface FormData {}
1288
+ interface Blob {}
1289
+ interface File {}
1290
+ interface ReadableStream<R = any> {}
1291
+ interface TransformStream<I = any, O = any> {}
1292
+ }
1293
+ //#endregion
1294
+ //#region ../../node_modules/.pnpm/@azure+core-http-compat@2.3.0/node_modules/@azure/core-http-compat/dist/esm/util.d.ts
1295
+ /**
1296
+ * An individual header within a HttpHeaders collection.
1297
+ */
1298
+ interface HttpHeader {
1299
+ /**
1300
+ * The name of the header.
1301
+ */
1302
+ name: string;
1303
+ /**
1304
+ * The value of the header.
1305
+ */
1306
+ value: string;
1307
+ }
1308
+ /**
1309
+ * A HttpHeaders collection represented as a simple JSON object.
1310
+ */
1311
+ type RawHttpHeaders = {
1312
+ [headerName: string]: string;
1313
+ };
1314
+ /**
1315
+ * A collection of HTTP header key/value pairs.
1316
+ */
1317
+ interface HttpHeadersLike {
1318
+ /**
1319
+ * Set a header in this collection with the provided name and value. The name is
1320
+ * case-insensitive.
1321
+ * @param headerName - The name of the header to set. This value is case-insensitive.
1322
+ * @param headerValue - The value of the header to set.
1323
+ */
1324
+ set(headerName: string, headerValue: string | number): void;
1325
+ /**
1326
+ * Get the header value for the provided header name, or undefined if no header exists in this
1327
+ * collection with the provided name.
1328
+ * @param headerName - The name of the header.
1329
+ */
1330
+ get(headerName: string): string | undefined;
1331
+ /**
1332
+ * Get whether or not this header collection contains a header entry for the provided header name.
1333
+ */
1334
+ contains(headerName: string): boolean;
1335
+ /**
1336
+ * Remove the header with the provided headerName. Return whether or not the header existed and
1337
+ * was removed.
1338
+ * @param headerName - The name of the header to remove.
1339
+ */
1340
+ remove(headerName: string): boolean;
1341
+ /**
1342
+ * Get the headers that are contained this collection as an object.
1343
+ */
1344
+ rawHeaders(): RawHttpHeaders;
1345
+ /**
1346
+ * Get the headers that are contained in this collection as an array.
1347
+ */
1348
+ headersArray(): HttpHeader[];
1349
+ /**
1350
+ * Get the header names that are contained in this collection.
1351
+ */
1352
+ headerNames(): string[];
1353
+ /**
1354
+ * Get the header values that are contained in this collection.
1355
+ */
1356
+ headerValues(): string[];
1357
+ /**
1358
+ * Create a deep clone/copy of this HttpHeaders collection.
1359
+ */
1360
+ clone(): HttpHeadersLike;
1361
+ /**
1362
+ * Get the JSON object representation of this HTTP header collection.
1363
+ * The result is the same as `rawHeaders()`.
1364
+ */
1365
+ toJson(options?: {
1366
+ preserveCase?: boolean;
1367
+ }): RawHttpHeaders;
1368
+ }
1369
+ /**
1370
+ * A collection of HTTP header key/value pairs.
1371
+ */
1372
+
1373
+ /**
1374
+ * An interface compatible with NodeJS's `http.Agent`.
1375
+ * We want to avoid publicly re-exporting the actual interface,
1376
+ * since it might vary across runtime versions.
1377
+ */
1378
+ interface Agent {
1379
+ /**
1380
+ * Destroy any sockets that are currently in use by the agent.
1381
+ */
1382
+ destroy(): void;
1383
+ /**
1384
+ * For agents with keepAlive enabled, this sets the maximum number of sockets that will be left open in the free state.
1385
+ */
1386
+ maxFreeSockets: number;
1387
+ /**
1388
+ * Determines how many concurrent sockets the agent can have open per origin.
1389
+ */
1390
+ maxSockets: number;
1391
+ /**
1392
+ * An object which contains queues of requests that have not yet been assigned to sockets.
1393
+ */
1394
+ requests: unknown;
1395
+ /**
1396
+ * An object which contains arrays of sockets currently in use by the agent.
1397
+ */
1398
+ sockets: unknown;
1399
+ }
1400
+ /**
1401
+ * A description of a HTTP request to be made to a remote server.
1402
+ */
1403
+ interface WebResourceLike {
1404
+ /**
1405
+ * The URL being accessed by the request.
1406
+ */
1407
+ url: string;
1408
+ /**
1409
+ * The HTTP method to use when making the request.
1410
+ */
1411
+ method: HttpMethods;
1412
+ /**
1413
+ * The HTTP body contents of the request.
1414
+ */
1415
+ body?: any;
1416
+ /**
1417
+ * The HTTP headers to use when making the request.
1418
+ */
1419
+ headers: HttpHeadersLike;
1420
+ /**
1421
+ * Whether or not the body of the HttpOperationResponse should be treated as a stream.
1422
+ * @deprecated Use streamResponseStatusCodes property instead.
1423
+ */
1424
+ streamResponseBody?: boolean;
1425
+ /**
1426
+ * A list of response status codes whose corresponding HttpOperationResponse body should be treated as a stream.
1427
+ */
1428
+ streamResponseStatusCodes?: Set<number>;
1429
+ /**
1430
+ * Form data, used to build the request body.
1431
+ */
1432
+ formData?: any;
1433
+ /**
1434
+ * A query string represented as an object.
1435
+ */
1436
+ query?: {
1437
+ [key: string]: any;
1438
+ };
1439
+ /**
1440
+ * If credentials (cookies) should be sent along during an XHR.
1441
+ */
1442
+ withCredentials: boolean;
1443
+ /**
1444
+ * The number of milliseconds a request can take before automatically being terminated.
1445
+ * If the request is terminated, an `AbortError` is thrown.
1446
+ */
1447
+ timeout: number;
1448
+ /**
1449
+ * Proxy configuration.
1450
+ */
1451
+ proxySettings?: ProxySettings;
1452
+ /**
1453
+ * If the connection should be reused.
1454
+ */
1455
+ keepAlive?: boolean;
1456
+ /**
1457
+ * Whether or not to decompress response according to Accept-Encoding header (node-fetch only)
1458
+ */
1459
+ decompressResponse?: boolean;
1460
+ /**
1461
+ * A unique identifier for the request. Used for logging and tracing.
1462
+ */
1463
+ requestId: string;
1464
+ /**
1465
+ * Signal of an abort controller. Can be used to abort both sending a network request and waiting for a response.
1466
+ */
1467
+ abortSignal?: AbortSignalLike;
1468
+ /**
1469
+ * Callback which fires upon upload progress.
1470
+ */
1471
+ onUploadProgress?: (progress: TransferProgressEvent) => void;
1472
+ /** Callback which fires upon download progress. */
1473
+ onDownloadProgress?: (progress: TransferProgressEvent) => void;
1474
+ /**
1475
+ * NODEJS ONLY
1476
+ *
1477
+ * A Node-only option to provide a custom `http.Agent`/`https.Agent`.
1478
+ * NOTE: usually this should be one instance shared by multiple requests so that the underlying
1479
+ * connection to the service can be reused.
1480
+ * Does nothing when running in the browser.
1481
+ */
1482
+ agent?: Agent;
1483
+ /**
1484
+ * Additional options to set on the request. This provides a way to override
1485
+ * existing ones or provide request properties that are not declared.
1486
+ *
1487
+ * For possible valid properties, see
1488
+ * - NodeJS https.request options: https://nodejs.org/api/http.html#httprequestoptions-callback
1489
+ * - Browser RequestInit: https://developer.mozilla.org/en-US/docs/Web/API/RequestInit
1490
+ *
1491
+ * WARNING: Options specified here will override any properties of same names when request is sent by {@link HttpClient}.
1492
+ */
1493
+ requestOverrides?: Record<string, unknown>;
1494
+ /**
1495
+ * Clone this request object.
1496
+ */
1497
+ clone(): WebResourceLike;
1498
+ /**
1499
+ * Validates that the required properties such as method, url, headers["Content-Type"],
1500
+ * headers["accept-language"] are defined. It will throw an error if one of the above
1501
+ * mentioned properties are not defined.
1502
+ * Note: this a no-op for compat purposes.
1503
+ */
1504
+ validateRequestProperties(): void;
1505
+ /**
1506
+ * This is a no-op for compat purposes and will throw if called.
1507
+ */
1508
+ prepare(options: unknown): WebResourceLike;
1509
+ }
1510
+ /**
1511
+ * Fired in response to upload or download progress.
1512
+ */
1513
+ type TransferProgressEvent = {
1514
+ /**
1515
+ * The number of bytes loaded so far.
1516
+ */
1517
+ loadedBytes: number;
1518
+ };
1519
+ //# sourceMappingURL=util.d.ts.map
1520
+ //#endregion
836
1521
  //#region src/util/toWebResourceLike.d.ts
837
1522
  declare const toWebResourceLike: (request: PipelineRequest) => WebResourceLike;
838
1523
  //#endregion
839
- export { BlobHierarchyItem, MockBlockBlobClient, MockContainerClient, MockRestError, MockTableClient, PageSettings, PagedAsyncIterableIterator, bodyToBuffer, getBlobItemXml, getBlobPrefixXml, isReadableStream, toWebResourceLike };
1524
+ export { BlobHierarchyItem, MockBlobBatchClient, MockBlobClient, MockBlockBlobClient, MockContainerClient, MockContainerDatabase, MockRestError, MockTableClient, MockTableDatabase, PageSettings, PagedAsyncIterableIterator, bodyToBuffer, getAzureErrorXml, getBlobItemXml, getBlobPrefixXml, isReadableStream, toWebResourceLike };