@directus/storage-driver-azure 11.0.0 → 11.0.2

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,4 +1,4 @@
1
- import { Driver, Range } from '@directus/storage';
1
+ import { Driver, ReadOptions } from '@directus/storage';
2
2
  import { Readable } from 'node:stream';
3
3
 
4
4
  type DriverAzureConfig = {
@@ -14,7 +14,7 @@ declare class DriverAzure implements Driver {
14
14
  private root;
15
15
  constructor(config: DriverAzureConfig);
16
16
  private fullPath;
17
- read(filepath: string, range?: Range): Promise<Readable>;
17
+ read(filepath: string, options?: ReadOptions): Promise<Readable>;
18
18
  write(filepath: string, content: Readable, type?: string): Promise<void>;
19
19
  delete(filepath: string): Promise<void>;
20
20
  stat(filepath: string): Promise<{
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/index.ts
2
2
  import { BlobServiceClient, StorageSharedKeyCredential } from "@azure/storage-blob";
3
3
  import { normalizePath } from "@directus/utils";
4
- import { join } from "path";
4
+ import { join } from "node:path";
5
5
  var DriverAzure = class {
6
6
  containerClient;
7
7
  signedCredentials;
@@ -18,7 +18,8 @@ var DriverAzure = class {
18
18
  fullPath(filepath) {
19
19
  return normalizePath(join(this.root, filepath));
20
20
  }
21
- async read(filepath, range) {
21
+ async read(filepath, options) {
22
+ const { range } = options || {};
22
23
  const { readableStreamBody } = await this.containerClient.getBlobClient(this.fullPath(filepath)).download(range?.start, range?.end ? range.end - (range.start || 0) + 1 : void 0);
23
24
  if (!readableStreamBody) {
24
25
  throw new Error(`No stream returned for file "${filepath}"`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/storage-driver-azure",
3
- "version": "11.0.0",
3
+ "version": "11.0.2",
4
4
  "description": "Azure file storage abstraction for `@directus/storage`",
5
5
  "homepage": "https://directus.io",
6
6
  "repository": {
@@ -21,16 +21,16 @@
21
21
  "dist"
22
22
  ],
23
23
  "dependencies": {
24
- "@azure/storage-blob": "12.23.0",
25
- "@directus/storage": "11.0.0",
26
- "@directus/utils": "12.0.0"
24
+ "@azure/storage-blob": "12.25.0",
25
+ "@directus/utils": "12.0.2",
26
+ "@directus/storage": "11.0.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@ngneat/falso": "7.2.0",
30
- "@vitest/coverage-v8": "1.5.3",
31
- "tsup": "8.2.2",
32
- "typescript": "5.4.5",
33
- "vitest": "1.5.3",
30
+ "@vitest/coverage-v8": "2.1.2",
31
+ "tsup": "8.3.0",
32
+ "typescript": "5.6.3",
33
+ "vitest": "2.1.2",
34
34
  "@directus/tsconfig": "2.0.0"
35
35
  },
36
36
  "scripts": {