@jrmc/adonis-attachment 4.0.0-beta.1 → 4.0.0-beta.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/README.md CHANGED
@@ -26,7 +26,7 @@ Project sample : [adonis-starter-kit](https://github.com/batosai/adonis-starter-
26
26
  - [x] [blurhash](https://blurha.sh/)
27
27
  - [x] documents thumbnail
28
28
  - [x] videos thumbnail
29
- - [ ] command regenerate
29
+ - [x] command regenerate
30
30
  - [x] command make:convert
31
31
  - [x] adonis-drive/flydrive
32
32
  - [x] jobs queue
@@ -60,7 +60,7 @@ const makeColumnOptions = (options) => {
60
60
  }
61
61
  },
62
62
  prepare: (value) => (value ? JSON.stringify(value.toObject()) : null),
63
- serialize: (value) => (value ? value.toJSON() : null),
63
+ serialize: options?.serialize !== undefined ? options?.serialize : (value) => (value ? value.toJSON() : null),
64
64
  ...columnOptions,
65
65
  };
66
66
  };
@@ -56,6 +56,8 @@ export type LucidOptions = {
56
56
  variants?: (keyof AttachmentVariants)[];
57
57
  rename?: boolean;
58
58
  meta?: boolean;
59
+ serialize?: (value?: Attachment) => unknown;
60
+ serializeAs?: string | null;
59
61
  };
60
62
  export type AttachmentBaseAttributes = {
61
63
  name?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jrmc/adonis-attachment",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.2",
4
4
  "type": "module",
5
5
  "description": "Turn any field on your Lucid model to an attachment data type",
6
6
  "engines": {