@orthacms/media-provider-s3 0.4.2 → 0.5.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.
@@ -1,5 +1,5 @@
1
1
  import { S3Client } from '@aws-sdk/client-s3';
2
- import type { StorageProvider } from '@orthacms/media-server';
2
+ import type { StorageProvider } from '@orthacms/media-domain';
3
3
  /**
4
4
  * Settings for an **S3-compatible** object store.
5
5
  *
@@ -6,7 +6,7 @@ const node_stream_1 = require("node:stream");
6
6
  const client_s3_1 = require("@aws-sdk/client-s3");
7
7
  const lib_storage_1 = require("@aws-sdk/lib-storage");
8
8
  const s3_request_presigner_1 = require("@aws-sdk/s3-request-presigner");
9
- const media_server_1 = require("@orthacms/media-server");
9
+ const media_domain_1 = require("@orthacms/media-domain");
10
10
  /** How many bytes one multipart part carries. The SDK's own minimum is 5 MB. */
11
11
  const PART_SIZE = 5 * 1024 * 1024;
12
12
  /** How many parts are in flight at once for one upload. */
@@ -124,13 +124,13 @@ function createS3StorageProvider(config) {
124
124
  try {
125
125
  const response = await client.send(new client_s3_1.GetObjectCommand({ Bucket: bucket, Key: storageKey }));
126
126
  if (!response.Body) {
127
- throw new media_server_1.ObjectNotFoundError(storageKey);
127
+ throw new media_domain_1.ObjectNotFoundError(storageKey);
128
128
  }
129
129
  return response.Body;
130
130
  }
131
131
  catch (error) {
132
132
  if (isMissing(error)) {
133
- throw new media_server_1.ObjectNotFoundError(storageKey, error);
133
+ throw new media_domain_1.ObjectNotFoundError(storageKey, error);
134
134
  }
135
135
  throw error;
136
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orthacms/media-provider-s3",
3
- "version": "0.4.2",
3
+ "version": "0.5.1",
4
4
  "description": "@orthacms/media-provider-s3 — part of Ortha CMS.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ortha-source/ortha-cms/tree/main/packages/media/provider-s3",
@@ -28,7 +28,7 @@
28
28
  "@aws-sdk/client-s3": "^3.716.0",
29
29
  "@aws-sdk/lib-storage": "^3.716.0",
30
30
  "@aws-sdk/s3-request-presigner": "^3.716.0",
31
- "@orthacms/media-server": "^0.4.2",
31
+ "@orthacms/media-domain": "^0.5.1",
32
32
  "tslib": "^2.3.0"
33
33
  },
34
34
  "publishConfig": {