@adminforth/rich-editor 1.3.0 → 1.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.
@@ -15,8 +15,6 @@ steps:
15
15
  from_secret: VAULT_TOKEN
16
16
  commands:
17
17
  - infisical export --domain https://vault.devforth.io/api --format=dotenv-export --env="prod" > /woodpecker/deploy.vault.env
18
- secrets:
19
- - VAULT_TOKEN
20
18
 
21
19
  release:
22
20
  image: node:20
package/dist/index.js CHANGED
@@ -51,9 +51,11 @@ export default class RichEditorPlugin extends AdminForthPlugin {
51
51
  if (!plugin) {
52
52
  throw new Error(`Plugin for attachment field '${this.options.attachments.attachmentFieldName}' not found in resource '${this.options.attachments.attachmentResource}', please check if Upload Plugin is installed on the field ${this.options.attachments.attachmentFieldName}`);
53
53
  }
54
- if (plugin.pluginOptions.s3ACL !== 'public-read') {
54
+ if (!plugin.pluginOptions.storageAdapter.objectCanBeAccesedPublicly()) {
55
55
  throw new Error(`Upload Plugin for attachment field '${this.options.attachments.attachmentFieldName}' in resource '${this.options.attachments.attachmentResource}'
56
- should have s3ACL set to 'public-read' (in vast majority of cases signed urls inside of HTML text is not desired behavior, so we did not implement it)`);
56
+ uses adapter which is not configured to store objects in public way, so it will produce only signed private URLs which can not be used in HTML text of blog posts.
57
+ Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
58
+ `);
57
59
  }
58
60
  this.uploadPlugin = plugin;
59
61
  }
package/index.ts CHANGED
@@ -57,9 +57,11 @@ export default class RichEditorPlugin extends AdminForthPlugin {
57
57
  throw new Error(`Plugin for attachment field '${this.options.attachments!.attachmentFieldName}' not found in resource '${this.options.attachments!.attachmentResource}', please check if Upload Plugin is installed on the field ${this.options.attachments!.attachmentFieldName}`);
58
58
  }
59
59
 
60
- if (plugin.pluginOptions.s3ACL !== 'public-read') {
60
+ if (!plugin.pluginOptions.storageAdapter.objectCanBeAccesedPublicly()) {
61
61
  throw new Error(`Upload Plugin for attachment field '${this.options.attachments!.attachmentFieldName}' in resource '${this.options.attachments!.attachmentResource}'
62
- should have s3ACL set to 'public-read' (in vast majority of cases signed urls inside of HTML text is not desired behavior, so we did not implement it)`);
62
+ uses adapter which is not configured to store objects in public way, so it will produce only signed private URLs which can not be used in HTML text of blog posts.
63
+ Please configure adapter in such way that it will store objects publicly (e.g. for S3 use 'public-read' ACL).
64
+ `);
63
65
  }
64
66
  this.uploadPlugin = plugin;
65
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/rich-editor",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Rich editor plugin for adminforth",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",