azure-mock 4.1.2 → 4.3.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/README.md CHANGED
@@ -23,7 +23,7 @@ pnpm i -D azure-mock @azure/core-http-compat @azure/core-rest-pipeline @azure/da
23
23
 
24
24
  ## <a name="documentation">📖 Documentation</a>
25
25
 
26
- We highly recommend you take a look at the [documentation](https://esposter.com/docs/api/modules/azure-mock.html) to level up.
26
+ We highly recommend you take a look at the [documentation](https://github.com/Esposter/Esposter/tree/main/openspec/specs) to level up.
27
27
 
28
28
  ### Available Mocks
29
29
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { HttpHeadersLike, WebResourceLike } from "@azure/core-http-compat";
2
2
  import { PipelineRequest, RestError } from "@azure/core-rest-pipeline";
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";
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, Metadata, 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
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";
@@ -838,7 +838,7 @@ export declare class MockBlobClient implements Except<BlobClient, "accountName">
838
838
  setHTTPHeaders(): Promise<BlobSetHTTPHeadersResponse>;
839
839
  setImmutabilityPolicy(): Promise<BlobSetImmutabilityPolicyResponse>;
840
840
  setLegalHold(): Promise<BlobSetLegalHoldResponse>;
841
- setMetadata(): Promise<BlobSetMetadataResponse>;
841
+ setMetadata(metadata?: Metadata): Promise<BlobSetMetadataResponse>;
842
842
  setTags(): Promise<BlobSetTagsResponse>;
843
843
  syncCopyFromURL(): Promise<BlobCopyFromURLResponse>;
844
844
  undelete(): Promise<BlobUndeleteResponse>;
package/dist/index.js CHANGED
@@ -371,8 +371,14 @@ var MockBlobClient = class {
371
371
  setLegalHold() {
372
372
  throw new NotImplementedError(this.setLegalHold.name);
373
373
  }
374
- setMetadata() {
375
- throw new NotImplementedError(this.setMetadata.name);
374
+ setMetadata(metadata) {
375
+ if (!this.container.has(this.name)) throw new MockRestError(BLOB_NOT_FOUND_MESSAGE, 404);
376
+ MockContainerBlobMetadataDatabase.set(getMockBlobKey(this.containerName, this.name), metadata ?? {});
377
+ storeMockBlobWrite(this.containerName, this.name, true);
378
+ return Promise.resolve({
379
+ _response: createMockResponse(200),
380
+ ...readMockBlobDates(this.containerName, this.name)
381
+ });
376
382
  }
377
383
  setTags() {
378
384
  throw new NotImplementedError(this.setTags.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azure-mock",
3
- "version": "4.1.2",
3
+ "version": "4.3.1",
4
4
  "description": "A library that contains azure mock classes.",
5
5
  "keywords": [
6
6
  "azure",
@@ -45,25 +45,19 @@
45
45
  },
46
46
  "scripts": {
47
47
  "build": "tsdown",
48
- "format": "oxfmt",
49
- "format:check": "oxfmt --check",
50
48
  "lint": "eslint .",
51
49
  "lint:fix": "eslint --fix .",
52
50
  "test": "vitest",
53
51
  "typecheck": "tsc"
54
52
  },
55
53
  "dependencies": {
56
- "@esposter/azure": "4.1.2",
57
- "@esposter/shared": "4.1.2"
54
+ "@esposter/azure": "4.3.1",
55
+ "@esposter/shared": "4.3.1"
58
56
  },
59
57
  "devDependencies": {
60
- "@arethetypeswrong/core": "^0.18.5",
61
- "@esposter/configuration": "4.1.2",
62
- "publint": "^0.3.25",
58
+ "@esposter/configuration": "4.3.1",
63
59
  "tsdown": "^0.23.1",
64
- "type-fest": "^5.10.0",
65
- "typedoc": "^0.28.20",
66
- "vitest": "^5.0.4"
60
+ "type-fest": "^5.10.0"
67
61
  },
68
62
  "peerDependencies": {
69
63
  "@azure/core-http-compat": "^2.5.0",
@@ -78,5 +72,5 @@
78
72
  "inlinedDependencies": {
79
73
  "type-fest": "5.10.0"
80
74
  },
81
- "gitHead": "144e3f98570b015e3181bfbc6cb70d346ce826b5"
75
+ "gitHead": "777a39636b789c13af33ed13370246ccf6dbaf31"
82
76
  }