next-tinacms-dos 0.0.0-cacbd0e-20250306051805 → 0.0.0-ce1414c-20251110052442

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
@@ -92,7 +92,7 @@ Call `createMediaHandler` to set up routes and connect your instance of the Medi
92
92
 
93
93
  Import `isAuthorized` from [`@tinacms/auth`](https://github.com/tinacms/tinacms/tree/main/packages/%40tinacms/auth).
94
94
 
95
- The `authorized` key will make it so only authorized users within Tina Cloud can upload and make media edits.
95
+ The `authorized` key will make it so only authorized users within TinaCloud can upload and make media edits.
96
96
 
97
97
 
98
98
  ```
package/dist/handlers.js CHANGED
@@ -55,7 +55,7 @@ var createMediaHandler = (config, options) => {
55
55
  mediaRoot = mediaRoot.substr(1);
56
56
  }
57
57
  }
58
- let cdnUrl = (options == null ? void 0 : options.cdnUrl) || config.config.endpoint.toString().replace(/http(s|):\/\//i, `https://${bucket}.`);
58
+ let cdnUrl = options?.cdnUrl || config.config.endpoint.toString().replace(/http(s|):\/\//i, `https://${bucket}.`);
59
59
  cdnUrl = cdnUrl + (cdnUrl.endsWith("/") ? "" : "/");
60
60
  return async (req, res) => {
61
61
  const isAuthorized = await config.authorized(req, res);
@@ -76,7 +76,6 @@ var createMediaHandler = (config, options) => {
76
76
  };
77
77
  };
78
78
  async function uploadMedia(req, res, client, bucket, mediaRoot, cdnUrl) {
79
- var _a;
80
79
  const upload = (0, import_util.promisify)(
81
80
  (0, import_multer.default)({
82
81
  storage: import_multer.default.diskStorage({
@@ -96,7 +95,7 @@ async function uploadMedia(req, res, client, bucket, mediaRoot, cdnUrl) {
96
95
  let prefix = directory.replace(/^\//, "").replace(/\/$/, "");
97
96
  if (prefix) prefix = prefix + "/";
98
97
  const filePath = req.file.path;
99
- const fileType = (_a = req.file) == null ? void 0 : _a.mimetype;
98
+ const fileType = req.file?.mimetype;
100
99
  const blob = import_fs.default.readFileSync(filePath);
101
100
  const filename = import_path.default.basename(filePath);
102
101
  const params = {
@@ -145,7 +144,6 @@ function stripMediaRoot(mediaRoot, key) {
145
144
  return keyParts.join("/");
146
145
  }
147
146
  async function listMedia(req, res, client, bucket, mediaRoot, cdnUrl) {
148
- var _a;
149
147
  try {
150
148
  const {
151
149
  directory = "",
@@ -158,12 +156,12 @@ async function listMedia(req, res, client, bucket, mediaRoot, cdnUrl) {
158
156
  Bucket: bucket,
159
157
  Delimiter: "/",
160
158
  Prefix: mediaRoot ? import_path.default.join(mediaRoot, prefix) : prefix,
161
- Marker: offset == null ? void 0 : offset.toString(),
159
+ Marker: offset?.toString(),
162
160
  MaxKeys: directory && !offset ? +limit + 1 : +limit
163
161
  };
164
162
  const response = await client.send(new import_client_s3.ListObjectsCommand(params));
165
163
  const items = [];
166
- (_a = response.CommonPrefixes) == null ? void 0 : _a.forEach(({ Prefix }) => {
164
+ response.CommonPrefixes?.forEach(({ Prefix }) => {
167
165
  const strippedPrefix = stripMediaRoot(mediaRoot, Prefix);
168
166
  if (!strippedPrefix) {
169
167
  return;
package/dist/index.js CHANGED
@@ -13,27 +13,27 @@
13
13
  const E_DEFAULT = new MediaListError({
14
14
  title: "An Error Occurred",
15
15
  message: "Something went wrong fetching your media from Digital Ocean Space.",
16
- docsLink: "https://tina.io/packages/next-tinacms-dos"
16
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces"
17
17
  });
18
18
  const E_UNAUTHORIZED = new MediaListError({
19
19
  title: "Unauthorized",
20
20
  message: "You don't have access to this resource.",
21
- docsLink: "https://tina.io/packages/next-tinacms-dos"
21
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces"
22
22
  });
23
23
  const E_CONFIG = new MediaListError({
24
24
  title: "Missing Credentials",
25
25
  message: "Unable to connect to Digital Ocean Space because one or more environment variables are missing.",
26
- docsLink: "https://tina.io/docs/media-dos/"
26
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces/"
27
27
  });
28
28
  const E_KEY_FAIL = new MediaListError({
29
29
  title: "Bad Credentials",
30
30
  message: "Unable to connect to Digital Ocean Space because one or more environment variables are misconfigured.",
31
- docsLink: "https://tina.io/docs/media-dos/"
31
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces/"
32
32
  });
33
33
  const E_BAD_ROUTE = new MediaListError({
34
34
  title: "Bad Route",
35
35
  message: "The Digital Ocean Space API route is missing or misconfigured.",
36
- docsLink: "https://tina.io/packages/next-tinacms-dos/#set-up-api-routes"
36
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces/#set-up-api-routes"
37
37
  });
38
38
  const interpretErrorMessage = (message) => {
39
39
  switch (message) {
package/dist/index.mjs CHANGED
@@ -10,27 +10,27 @@ class MediaListError extends Error {
10
10
  const E_DEFAULT = new MediaListError({
11
11
  title: "An Error Occurred",
12
12
  message: "Something went wrong fetching your media from Digital Ocean Space.",
13
- docsLink: "https://tina.io/packages/next-tinacms-dos"
13
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces"
14
14
  });
15
15
  const E_UNAUTHORIZED = new MediaListError({
16
16
  title: "Unauthorized",
17
17
  message: "You don't have access to this resource.",
18
- docsLink: "https://tina.io/packages/next-tinacms-dos"
18
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces"
19
19
  });
20
20
  const E_CONFIG = new MediaListError({
21
21
  title: "Missing Credentials",
22
22
  message: "Unable to connect to Digital Ocean Space because one or more environment variables are missing.",
23
- docsLink: "https://tina.io/docs/media-dos/"
23
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces/"
24
24
  });
25
25
  const E_KEY_FAIL = new MediaListError({
26
26
  title: "Bad Credentials",
27
27
  message: "Unable to connect to Digital Ocean Space because one or more environment variables are misconfigured.",
28
- docsLink: "https://tina.io/docs/media-dos/"
28
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces/"
29
29
  });
30
30
  const E_BAD_ROUTE = new MediaListError({
31
31
  title: "Bad Route",
32
32
  message: "The Digital Ocean Space API route is missing or misconfigured.",
33
- docsLink: "https://tina.io/packages/next-tinacms-dos/#set-up-api-routes"
33
+ docsLink: "https://tina.io/docs/r/digital-ocean-spaces/#set-up-api-routes"
34
34
  });
35
35
  const interpretErrorMessage = (message) => {
36
36
  switch (message) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-tinacms-dos",
3
- "version": "0.0.0-cacbd0e-20250306051805",
3
+ "version": "0.0.0-ce1414c-20251110052442",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "files": [
@@ -18,7 +18,7 @@
18
18
  ]
19
19
  },
20
20
  "peerDependencies": {
21
- "tinacms": "0.0.0-cacbd0e-20250306051805"
21
+ "tinacms": "0.0.0-ce1414c-20251110052442"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/crypto-js": "^3.1.47",
@@ -28,8 +28,8 @@
28
28
  "react": "^18.3.1",
29
29
  "react-dom": "^18.3.1",
30
30
  "typescript": "^5.7.3",
31
- "@tinacms/scripts": "1.3.3",
32
- "tinacms": "0.0.0-cacbd0e-20250306051805"
31
+ "@tinacms/scripts": "1.4.0",
32
+ "tinacms": "0.0.0-ce1414c-20251110052442"
33
33
  },
34
34
  "publishConfig": {
35
35
  "registry": "https://registry.npmjs.org"