azure-mock 3.5.0 → 3.6.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
@@ -3,10 +3,10 @@ import { PipelineRequest, RestError } from "@azure/core-rest-pipeline";
3
3
  import { AnonymousCredential, AppendBlobClient, BlobAbortCopyFromURLResponse, BlobBatchClient, BlobBatchDeleteBlobsResponse, BlobBeginCopyFromURLResponse, BlobClient, BlobCopyFromURLResponse, BlobCreateSnapshotResponse, BlobDeleteIfExistsResponse, BlobDeleteImmutabilityPolicyResponse, BlobDeleteOptions, BlobDeleteResponse, BlobDownloadResponseModel, BlobDownloadResponseParsed, BlobGenerateSasUrlOptions, BlobGetAccountInfoResponse, BlobGetPropertiesResponse, BlobGetTagsResponse, BlobHierarchyListSegment, BlobItem, BlobLeaseClient, BlobPrefix, BlobSetHTTPHeadersResponse, BlobSetImmutabilityPolicyResponse, BlobSetLegalHoldResponse, BlobSetMetadataResponse, BlobSetTagsResponse, BlobSetTierResponse, BlobUndeleteResponse, BlobUploadCommonResponse, BlockBlobClient, BlockBlobCommitBlockListResponse, BlockBlobGetBlockListResponse, BlockBlobPutBlobFromUrlResponse, BlockBlobStageBlockFromURLResponse, BlockBlobStageBlockResponse, BlockBlobUploadOptions, BlockBlobUploadResponse, ContainerClient, ContainerCreateIfNotExistsResponse, ContainerCreateResponse, ContainerDeleteIfExistsResponse, ContainerDeleteResponse, ContainerFindBlobsByTagsSegmentResponse, ContainerGenerateSasUrlOptions, ContainerGetAccessPolicyResponse, ContainerGetAccountInfoResponse, ContainerGetPropertiesResponse, ContainerListBlobFlatSegmentResponse, ContainerListBlobHierarchySegmentResponse, ContainerListBlobsOptions, ContainerSetAccessPolicyResponse, ContainerSetMetadataResponse, FilterBlobItem, HttpRequestBody, PageBlobClient, PollOperationState, PollerLikeWithCancellation, StorageSharedKeyCredential } from "@azure/storage-blob";
4
4
  import { BinaryOperator, Clause } from "@esposter/azure";
5
5
  import { EventGridEvent, EventGridPublisherClient } from "@azure/eventgrid";
6
- import { ServiceBusMessage, ServiceBusMessageBatch, ServiceBusSender } from "@azure/service-bus";
7
- import { CreateTableEntityResponse, GetAccessPolicyResponse, GetTableEntityResponse, ListTableEntitiesOptions, TableClient, TableDeleteEntityHeaders, TableEntity, TableEntityResult, TableEntityResultPage, TableMergeEntityHeaders, TableSetAccessPolicyHeaders, TableTransactionResponse, UpdateMode } from "@azure/data-tables";
8
6
  import { QueueClearMessagesResponse, QueueClient, QueueCreateIfNotExistsResponse, QueueCreateOptions, QueueCreateResponse, QueueDeleteIfExistsResponse, QueueDeleteMessageResponse, QueueDeleteResponse, QueueGenerateSasUrlOptions, QueueGetAccessPolicyResponse, QueueGetPropertiesResponse, QueueItem, QueuePeekMessagesOptions, QueuePeekMessagesResponse, QueueReceiveMessageOptions, QueueReceiveMessageResponse, QueueSendMessageOptions, QueueSendMessageResponse, QueueServiceProperties, QueueSetAccessPolicyResponse, QueueSetMetadataResponse, QueueUpdateMessageResponse, SignedIdentifier } from "@azure/storage-queue";
9
7
  import { AutocompleteResult, CountDocumentsOptions, DeleteDocumentsOptions, GetDocumentOptions, IndexDocumentsBatch, IndexDocumentsOptions, IndexDocumentsResult, MergeDocumentsOptions, MergeOrUploadDocumentsOptions, NarrowedModel, SearchClient, SearchDocumentsResult, SearchOptions, SelectFields, SuggestDocumentsResult, SuggestOptions, UploadDocumentsOptions } from "@azure/search-documents";
8
+ import { ServiceBusMessage, ServiceBusMessageBatch, ServiceBusSender } from "@azure/service-bus";
9
+ import { CreateTableEntityResponse, GetAccessPolicyResponse, GetTableEntityResponse, ListTableEntitiesOptions, TableClient, TableDeleteEntityHeaders, TableEntity, TableEntityResult, TableEntityResultPage, TableMergeEntityHeaders, TableSetAccessPolicyHeaders, TableTransactionResponse, UpdateMode } from "@azure/data-tables";
10
10
  //#region src/constants.d.ts
11
11
  export declare const BLOB_NOT_FOUND_ERROR_CODE = "BlobNotFound";
12
12
  export declare const BLOB_NOT_FOUND_MESSAGE = "The specified blob does not exist.";
@@ -15,37 +15,6 @@ export declare const MOCK_QUEUE_BASE_URL = "https://mockaccount.queue.core.windo
15
15
  export declare const MOCK_SEARCH_BASE_URL = "https://mockaccount.search.windows.net";
16
16
  export declare const MOCK_TABLE_BASE_URL = "https://mockaccount.table.core.windows.net";
17
17
  //#endregion
18
- //#region src/models/container/MockBlobDates.d.ts
19
- export interface MockBlobDates {
20
- createdOn: Date;
21
- etag: string;
22
- lastModified: Date;
23
- }
24
- //#endregion
25
- //#region src/store/MockContainerBlobDatesDatabase.d.ts
26
- export declare const MockContainerBlobDatesDatabase: Map<string, MockBlobDates>;
27
- //#endregion
28
- //#region src/store/MockContainerBlobMetadataDatabase.d.ts
29
- export declare const MockContainerBlobMetadataDatabase: Map<string, Record<string, string>>;
30
- //#endregion
31
- //#region src/store/MockContainerDatabase.d.ts
32
- export declare const MockContainerDatabase: Map<string, Map<string, Buffer>>;
33
- //#endregion
34
- //#region src/store/MockEventGridDatabase.d.ts
35
- export declare const MockEventGridDatabase: Map<string, EventGridEvent<unknown>[]>;
36
- //#endregion
37
- //#region src/store/MockQueueDatabase.d.ts
38
- export declare const MockQueueDatabase: Map<string, string[]>;
39
- //#endregion
40
- //#region src/store/MockSearchDatabase.d.ts
41
- export declare const MockSearchDatabase: Map<string, object[]>;
42
- //#endregion
43
- //#region src/store/MockServiceBusDatabase.d.ts
44
- export declare const MockServiceBusDatabase: Map<string, ServiceBusMessage[]>;
45
- //#endregion
46
- //#region src/store/MockTableDatabase.d.ts
47
- export declare const MockTableDatabase: Map<string, Map<string, TableEntity>>;
48
- //#endregion
49
18
  //#region src/models/container/BlobHierarchyItem.d.ts
50
19
  export type BlobHierarchyItem = (BlobItem & {
51
20
  kind: "blob";
@@ -53,6 +22,9 @@ export type BlobHierarchyItem = (BlobItem & {
53
22
  kind: "prefix";
54
23
  });
55
24
  //#endregion
25
+ //#region src/store/MockContainerDatabase.d.ts
26
+ export declare const MockContainerDatabase: Map<string, Map<string, Buffer>>;
27
+ //#endregion
56
28
  //#region src/util/types/MapValue.d.ts
57
29
  export type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;
58
30
  //#endregion
@@ -872,6 +844,13 @@ export declare class MockBlobClient implements Except<BlobClient, "accountName">
872
844
  withVersion(): BlobClient;
873
845
  }
874
846
  //#endregion
847
+ //#region src/models/container/MockBlobDates.d.ts
848
+ export interface MockBlobDates {
849
+ createdOn: Date;
850
+ etag: string;
851
+ lastModified: Date;
852
+ }
853
+ //#endregion
875
854
  //#region src/models/container/MockBlockBlobClient.d.ts
876
855
  export declare class MockBlockBlobClient extends MockBlobClient implements Except<BlockBlobClient, "accountName"> {
877
856
  commitBlockList(): Promise<BlockBlobCommitBlockListResponse>;
@@ -982,6 +961,9 @@ export declare class MockEventGridPublisherClient implements Except<EventGridPub
982
961
  send(newEvents: EventGridEvent<unknown>[]): Promise<void>;
983
962
  }
984
963
  //#endregion
964
+ //#region src/store/MockQueueDatabase.d.ts
965
+ export declare const MockQueueDatabase: Map<string, string[]>;
966
+ //#endregion
985
967
  //#region src/models/queue/MockQueueClient.d.ts
986
968
  /**
987
969
  * An in-memory mock of the Azure QueueClient — no emulator and no network.
@@ -1021,6 +1003,9 @@ export declare class MockQueueClient implements Except<QueueClient, "accountName
1021
1003
  updateMessage(): Promise<QueueUpdateMessageResponse>;
1022
1004
  }
1023
1005
  //#endregion
1006
+ //#region src/store/MockSearchDatabase.d.ts
1007
+ export declare const MockSearchDatabase: Map<string, object[]>;
1008
+ //#endregion
1024
1009
  //#region src/models/search/MockSearchClient.d.ts
1025
1010
  /**
1026
1011
  * An in-memory mock of the Azure SearchClient — no emulator and no network. It applies the same OData filtering
@@ -1051,6 +1036,9 @@ export declare class MockSearchClient<TModel extends object = Record<string, unk
1051
1036
  uploadDocuments(documents: TModel[], _options?: UploadDocumentsOptions): Promise<IndexDocumentsResult>;
1052
1037
  }
1053
1038
  //#endregion
1039
+ //#region src/store/MockServiceBusDatabase.d.ts
1040
+ export declare const MockServiceBusDatabase: Map<string, ServiceBusMessage[]>;
1041
+ //#endregion
1054
1042
  //#region src/models/serviceBus/MockServiceBusSender.d.ts
1055
1043
  /**
1056
1044
  * An in-memory mock of the Azure ServiceBusSender — no emulator and no network.
@@ -1090,6 +1078,9 @@ export declare class NotImplementedError extends Error {
1090
1078
  constructor(name: string);
1091
1079
  }
1092
1080
  //#endregion
1081
+ //#region src/store/MockTableDatabase.d.ts
1082
+ export declare const MockTableDatabase: Map<string, Map<string, TableEntity>>;
1083
+ //#endregion
1093
1084
  //#region src/models/table/MockTableClient.d.ts
1094
1085
  /**
1095
1086
  * An in-memory mock of the Azure TableClient — no emulator and no network.
@@ -1234,4 +1225,13 @@ export declare const getMockSasUrl: (url: string, permissions: undefined | {
1234
1225
  //#endregion
1235
1226
  //#region src/services/table/compareByCompositeKey.d.ts
1236
1227
  export declare const compareByCompositeKey: (firstEntity: TableEntity, secondEntity: TableEntity) => number;
1228
+ //#endregion
1229
+ //#region src/store/MockContainerBlobDatesDatabase.d.ts
1230
+ export declare const MockContainerBlobDatesDatabase: Map<string, MockBlobDates>;
1231
+ //#endregion
1232
+ //#region src/store/MockContainerBlobMetadataDatabase.d.ts
1233
+ export declare const MockContainerBlobMetadataDatabase: Map<string, Record<string, string>>;
1234
+ //#endregion
1235
+ //#region src/store/MockEventGridDatabase.d.ts
1236
+ export declare const MockEventGridDatabase: Map<string, EventGridEvent<unknown>[]>;
1237
1237
  //#endregion
package/dist/index.js CHANGED
@@ -13,6 +13,9 @@ const MOCK_QUEUE_BASE_URL = "https://mockaccount.queue.core.windows.net";
13
13
  const MOCK_SEARCH_BASE_URL = "https://mockaccount.search.windows.net";
14
14
  const MOCK_TABLE_BASE_URL = "https://mockaccount.table.core.windows.net";
15
15
  //#endregion
16
+ //#region src/services/container/getMockBlobKey.ts
17
+ const getMockBlobKey = (containerName, blobName) => `${encodeURIComponent(containerName)}${ID_SEPARATOR}${encodeURIComponent(blobName)}`;
18
+ //#endregion
16
19
  //#region src/store/MockContainerBlobDatesDatabase.ts
17
20
  const MockContainerBlobDatesDatabase = /* @__PURE__ */ new Map();
18
21
  //#endregion
@@ -29,24 +32,6 @@ var MockContainerDatabaseMap = class extends Map {
29
32
  };
30
33
  const MockContainerDatabase = new MockContainerDatabaseMap();
31
34
  //#endregion
32
- //#region src/store/MockEventGridDatabase.ts
33
- const MockEventGridDatabase = /* @__PURE__ */ new Map();
34
- //#endregion
35
- //#region src/store/MockQueueDatabase.ts
36
- const MockQueueDatabase = /* @__PURE__ */ new Map();
37
- //#endregion
38
- //#region src/store/MockSearchDatabase.ts
39
- const MockSearchDatabase = /* @__PURE__ */ new Map();
40
- //#endregion
41
- //#region src/store/MockServiceBusDatabase.ts
42
- const MockServiceBusDatabase = /* @__PURE__ */ new Map();
43
- //#endregion
44
- //#region src/store/MockTableDatabase.ts
45
- const MockTableDatabase = /* @__PURE__ */ new Map();
46
- //#endregion
47
- //#region src/services/container/getMockBlobKey.ts
48
- const getMockBlobKey = (containerName, blobName) => `${encodeURIComponent(containerName)}${ID_SEPARATOR}${encodeURIComponent(blobName)}`;
49
- //#endregion
50
35
  //#region src/services/container/getMockContainer.ts
51
36
  const getMockContainer = (containerName) => getOrCreate(MockContainerDatabase, containerName, () => /* @__PURE__ */ new Map());
52
37
  //#endregion
@@ -711,6 +696,9 @@ var MockContainerClient = class {
711
696
  }
712
697
  };
713
698
  //#endregion
699
+ //#region src/store/MockEventGridDatabase.ts
700
+ const MockEventGridDatabase = /* @__PURE__ */ new Map();
701
+ //#endregion
714
702
  //#region src/models/eventGrid/MockEventGridPublisherClient.ts
715
703
  /**
716
704
  * An in-memory mock of the Azure EventGridPublisherClient — no emulator and no network.
@@ -742,6 +730,9 @@ const getMockQueueMessageItem = (messageText) => {
742
730
  };
743
731
  };
744
732
  //#endregion
733
+ //#region src/store/MockQueueDatabase.ts
734
+ const MockQueueDatabase = /* @__PURE__ */ new Map();
735
+ //#endregion
745
736
  //#region src/models/queue/MockQueueClient.ts
746
737
  /**
747
738
  * An in-memory mock of the Azure QueueClient — no emulator and no network.
@@ -929,6 +920,9 @@ const createFilterPredicate = (filter) => {
929
920
  };
930
921
  };
931
922
  //#endregion
923
+ //#region src/store/MockSearchDatabase.ts
924
+ const MockSearchDatabase = /* @__PURE__ */ new Map();
925
+ //#endregion
932
926
  //#region src/models/search/MockSearchClient.ts
933
927
  const toComparable = (value) => {
934
928
  if (value instanceof Date) return value.getTime();
@@ -1039,6 +1033,9 @@ var MockSearchClient = class {
1039
1033
  }
1040
1034
  };
1041
1035
  //#endregion
1036
+ //#region src/store/MockServiceBusDatabase.ts
1037
+ const MockServiceBusDatabase = /* @__PURE__ */ new Map();
1038
+ //#endregion
1042
1039
  //#region src/models/serviceBus/MockServiceBusSender.ts
1043
1040
  /**
1044
1041
  * An in-memory mock of the Azure ServiceBusSender — no emulator and no network.
@@ -1089,6 +1086,9 @@ const compareByCompositeKey = (firstEntity, secondEntity) => {
1089
1086
  else return firstEntity.rowKey < secondEntity.rowKey ? -1 : 1;
1090
1087
  };
1091
1088
  //#endregion
1089
+ //#region src/store/MockTableDatabase.ts
1090
+ const MockTableDatabase = /* @__PURE__ */ new Map();
1091
+ //#endregion
1092
1092
  //#region src/models/table/MockTableClient.ts
1093
1093
  /**
1094
1094
  * An in-memory mock of the Azure TableClient — no emulator and no network.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-mock",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "description": "A library that contains azure mock classes.",
5
5
  "keywords": [
6
6
  "azure",
@@ -45,7 +45,6 @@
45
45
  },
46
46
  "scripts": {
47
47
  "build": "tsdown",
48
- "export:gen": "generate-exports",
49
48
  "format": "oxfmt",
50
49
  "format:check": "oxfmt --check",
51
50
  "lint": "eslint .",
@@ -54,13 +53,13 @@
54
53
  "typecheck": "tsc"
55
54
  },
56
55
  "dependencies": {
57
- "@esposter/azure": "3.5.0",
58
- "@esposter/shared": "3.5.0",
56
+ "@esposter/azure": "3.6.0",
57
+ "@esposter/shared": "3.6.0",
59
58
  "fast-deep-equal": "^3.1.3"
60
59
  },
61
60
  "devDependencies": {
62
61
  "@arethetypeswrong/core": "^0.18.5",
63
- "@esposter/configuration": "3.5.0",
62
+ "@esposter/configuration": "3.6.0",
64
63
  "publint": "^0.3.24",
65
64
  "tsdown": "^0.23.0",
66
65
  "type-fest": "^5.10.0",
@@ -80,5 +79,5 @@
80
79
  "inlinedDependencies": {
81
80
  "type-fest": "5.10.0"
82
81
  },
83
- "gitHead": "dd47fa9c4f07dcf7a9ce49a09874a6bcf4e4ace4"
82
+ "gitHead": "07f63a48503626e6f02f64e778a2e8e4838b55e2"
84
83
  }