next-tinacms-s3 1.1.0 → 1.2.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/LICENSE +8 -0
- package/dist/errors.d.ts +1 -10
- package/dist/handlers.d.ts +1 -10
- package/dist/handlers.js +6 -4
- package/dist/index.d.ts +1 -10
- package/dist/index.es.js +54877 -20
- package/dist/index.js +54879 -22
- package/dist/s3-media-store.d.ts +1 -11
- package/dist/s3-tina-cloud-media-store.d.ts +1 -10
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
Copyright (c) 2023-present Forestry.io Holdings Inc.
|
|
2
|
+
|
|
3
|
+
Portions of the TinaCMS software are licensed as follows:
|
|
4
|
+
|
|
5
|
+
* All software that resides under the "packages/@tinacms/datalayer/" and the "packages/@tinacms/graphql/" directories (the "Tina Data Layer"), is licensed under the license defined in "packages/@tinacms/datalayer/LICENSE".
|
|
6
|
+
|
|
7
|
+
* All software outside of the above-mentioned directories is available under the "Apache 2.0" license as set forth below.
|
|
8
|
+
|
|
1
9
|
Apache License
|
|
2
10
|
Version 2.0, January 2004
|
|
3
11
|
http://www.apache.org/licenses/
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
interface MediaListErrorConfig {
|
|
14
5
|
title: string;
|
package/dist/handlers.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import { S3ClientConfig } from '@aws-sdk/client-s3';
|
|
14
5
|
import { NextApiRequest, NextApiResponse } from 'next';
|
package/dist/handlers.js
CHANGED
|
@@ -91,13 +91,14 @@ async function uploadMedia(req, res, client, bucket, cdnUrl) {
|
|
|
91
91
|
const command = new import_client_s3.PutObjectCommand(params);
|
|
92
92
|
try {
|
|
93
93
|
await client.send(command);
|
|
94
|
+
const src = cdnUrl + prefix + filename;
|
|
94
95
|
res.json({
|
|
95
96
|
type: "file",
|
|
96
97
|
id: prefix + filename,
|
|
97
98
|
filename,
|
|
98
99
|
directory: prefix,
|
|
99
|
-
|
|
100
|
-
src
|
|
100
|
+
thumbnail: src,
|
|
101
|
+
src
|
|
101
102
|
});
|
|
102
103
|
} catch (e) {
|
|
103
104
|
res.status(500).send(findErrorMessage(e));
|
|
@@ -176,12 +177,13 @@ function getS3ToTinaFunc(cdnUrl) {
|
|
|
176
177
|
return function s3ToTina(file) {
|
|
177
178
|
const filename = import_path.default.basename(file.Key);
|
|
178
179
|
const directory = import_path.default.dirname(file.Key) + "/";
|
|
180
|
+
const src = cdnUrl + file.Key;
|
|
179
181
|
return {
|
|
180
182
|
id: file.Key,
|
|
181
183
|
filename,
|
|
182
184
|
directory,
|
|
183
|
-
src
|
|
184
|
-
|
|
185
|
+
src,
|
|
186
|
+
thumbnail: src,
|
|
185
187
|
type: "file"
|
|
186
188
|
};
|
|
187
189
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
export * from './s3-media-store';
|
|
14
5
|
export * from './s3-tina-cloud-media-store';
|